Solved by ptrblck in post #2 
              
              
                You could sample the random crop size once for the next batch and resample in each iteration of your DataLoader. 
Maybe not the most elegant approach, but should do the job. 
Here is a small dummy example: 
class MyDataset(Dataset):
    def __init__(self, limit):
        self.data = [TF.to_pil_image…