I am using affine grid and grid sample to rotate an image by 90 degrees. This is the original image

This is the output of grid sample. The aspect ratio is not maintained.

This is the expected output with padding set to zeros.

Is there anything else that needs to be considered?