How to do warping via sparial transform network?

I have two inputs I1 and I2, does anyone know how we can use two images and stn for warping one to another?

Any suggestion on this?

Fig 1 in this paper basically is close to what i want to do, the difference is that, i have two inputs and i want to warp one to the other oneā€¦

Use torch.nn.functional.grid_sample.