Hi, I contruct my own dataset according to the data loading tutorial and using the standard Dataloader provide by PyTorch. The code is like this,
train_set = MyDataset(some_parameter...)
train_loader = Dataloader(dataset=train_set, other_setting...)

for batch_idx , data, target in enumerate(train_loader):
     #training processing

After several training epoch, I would like to regenerate my training dataset, I have written a custom member funtion regenerate_sample() for MyDataset. So I can just use train_set.regenerate_sample() to change the samples in train_set.
But what I am not sure about is will this change be reflected on train_loader, i.e., will train_loader now generate batch of samples from the new dataset samples instead of the old dataset? Or  do I have to manually construct a new Dataloader object in order to use the newly updated dataset?  like the following,
train_set.regenerate_sample()
train_loader = Dataloader(dataset=train_set, other_setting...)

Which is the case? I am a little confused.