Thank you so much for your reply. Can you explain what does the argument of F.affine_grid represent? Like, it is a b23 matrix where in that 2*3 matrices, it contains some affine transformation arguments. Can you explain which element is for scaling and which is for translation?