Hi @IanYeung and @hubertlee915,
I also had the same problem, but I guess this is how to address it:
Suppose your image has a shape of [H,W],
then you would need to normalize the values of the horizontal flow map by W, and those of vertical flow map by H.
If you want to do warping, this normalized flow map should be added to an x-y meshgrid of [-1,1] with shape of [H,W], something like this:
np.meshgrid(np.linspace(-1,1,W), np.linspace(-1,1,H)).
The resulting map can be given as the grid argument to the grid_sample function.