You can use the functional API to transform your data and target with the same random values, e.g. for random cropping
Thank you this was what I was looking for.
TF is import torchvision.transforms.functional as TF correct?