Solved by ptrblck in post #2 
              
              
                I think you would need to apply the random transformations on each sample and could use e.g. transforms.Lambda for it: 
# setup
x = torch.zeros(3, 10, 10)
x[:, 3:7, 3:7] = 1.

# same transformation on each sample
transform = transforms.RandomCrop(size=5)
y1 = transform(x)
print(y1)

# apply transfor…