Mapping of old pixels to new using torchvision.transforms.functional.rotate

Its very simple you just have to create a rotation matrix :

or you can check this post for suggested codes: