__getitem__ indexes following a prepared file/list

Hi, I want that my dataloader will follow and sample indexes by using a prepared order.
Means, I don’t want my dataloader to sample indexes randomly and not by sequential order, but by using a file or list that I prepared from advance.
Any idea of how to implement such a thing?
Thanks.

You could prepare a dictionary that map the index in getitem to your own order

It was ok if in each epoch we had the same mapping, but I’m planning to give different order in each epoch, just like shuffling the data.