If I sample a square image using F.grid_sample(input, grid), where the grid has been created using F.affine_grid(theta, size), with a non zero rotation part of theta, I get the expected result. If I do the same for a non square image I get a very skewed image.
grid_sample_example1920×983 25.4 KB
Is this the intended behavior? And if so is there another easy way to get a sampled image that is not skewed when sampling non square images?
Note: in the minimal examples here theta only has a rotation part. No translation. In the real task where I want to use affine_grid and grid_sample I am using both rotation and translation.