import torch


def boxes_scale(boxes, scale):
    """Scale boxes. boxes: [N, (y1, x1, y2, x2)], scale: [sy1, sx1, sy2, sx2]."""
    t = torch.Tensor(scale)
    if boxes.is_cuda:
        t = t.cuda()
    return boxes * t