Solved by ptrblck in post #2 
              
              
                The DataLoader seems to use a reference to the Dataset object, so that your regenerate should work. 
Here is a small sample code, which works fine for me: 
class MyDataset(Dataset):
    def __init__(self, data):
        self.data = data

    def __getitem__(self, index):
        return self.data[ind…