If you want to use a bilinear or nearest neighbor interpolation, you could use `grid_sample](https://pytorch.org/docs/stable/nn.functional.html?highlight=grid_sample#torch.nn.functional.grid_sample 278).