Shuffle outside of batch

Is there any way to shuffle between batch but don’t interrupt the order within each batch?
Many Thanks!

i dont actually understand what you mean (the sentence is very confusing). Can you give an example?

You can do it at a data preprocessing stage:

List of batches -> shuffle it -> feed each batch to the model on the training loop

u can form batch data at Dataset and get a list of batched data, then use Dataloader to shuffle this list.