Rotation sampling grid is undesireably low-res
Author: danielgordon10Created Apr 22, 2025Updated Sep 5, 2026
Describe the bug
This function that creates the resampling grid will use the default tensor dtype. If this is bfloat16/float16 and the image is sufficiently large (over 250x250 px), this results in significant quantizing that seems undesirable. The output will look extremely subsampled from the original. This would not occur if the dtype was higher precision.
My suggestion would be to update these linspace to either be dtype=theta.dtype or explicitly dtype=torch.float32 to prevent this from happening.
Versions
Current
Source: pytorch/vision