affine_grid should mostly return grid locations ins [-1, 1], which represent the sampling pixel locations normalized by the image dimension. The value [-1, -1] represents the left-top pixel, while [1, 1] is the right-bottom one. Values out of this range will be using the padding mode in grid_sample.