I want to do something like this: https://github.com/mrharicot/monodepth/blob/master/bilinear_sampler.py 177
Inputs are input_image of size 1x1x256x512 and offset of size 1x1x256x512. I need to sample input_image and move each pixel in x direction according to offset.
Can I use torch.nn.functional.grid_sample 66? If yes, how? Any suggestion is highly appreciated.