import torch


def get_shifted_img(img: torch.Tensor, gx: int, gy: int):
    """Receives input image img and returns a shifted version,
    where the shift in the x direction is given by gx and in the y direction
    by gy."""
    img_ret = img.clone()
    img_ret = torch.roll(img_ret, (gx, gy), dims=(-2, -1))
    return img_ret