def apply_shifts(shiftNet, images, thetas, device):
    """
    Applies sub-pixel translations to images with Lanczos interpolation.
    Args:
        shiftNet: torch.model
        images: tensor (batch size, views, C, W, H), images to shift
        thetas: tensor (batch size, views, 2), translation params
    Returns:
        new_images: tensor (batch size, views, C, W, H), warped images
    """

    batch_size, n_views, channels, height, width = images.shape
    images = images.view(-1, channels, height, width)
    thetas = thetas.view(-1, 2)

    new_images = shiftNet.transform(thetas, images, device=device)

    return new_images.view(-1, n_views, channels, images.size(2), images.size(3))