Avoiding for loop for image rotation

I am trying to use torchvision.transforms.functional.rotate to rotate a batch of images (e.g. a tensor with shape [1000, 96, 96], i.e. 1k images). This works well if they are to be rotated by the same angle. In my case I have a vector of angles, one for each image.
Is there a way to do this without running a for loop over each image to individually perform the rotation?

Thanks a lot in advance!

I am not sure if a direct method exists in torchvision.
However, you could achieve it using kornia library by first getting the rotation matrices from angles, then using warp_affine to warp the images using these rotation matrices.