You could either load the sequence in the __getitem__
method while the DataLoader
and sampler are only providing the “start index” (you would need to adapt the __len__
of your Dataset
for this approach) or you could create a custom sampler, which will yield the desired “shuffled” indices through a BatchSampler
.
Here is a simple example of the first use case.