In PyTorch, when you apply random transformations/augmentations to images, they are generally not transformed in the same way in each epoch. The transformations are meant to be random and are applied independently for each image at each call. This means that the image with index idx will likely get a different transformation at each call, making the augmented image different in every epoch.
This randomness in transformations helps the model become more robust and generalize better, as it learns from a wider variety of augmented images.
Thanks for the answer, that clarifies a lot.
What can I do to keep random augmentations fixed for some iterations? I need to compare the same image 2-3 times and I dont want it to be altered every time I get it.