I’m not sure I understand the use case completely, but



 JalleNation:

Since the DataLoader is pulling the index from getitem and that in turn pulls an index between 1 and len from the data,


that’s not the case. By default (unless you are creating your own DataLoader) the sampler will be used to create the batch indices and the DataLoader will grab these indices and pass it to Dataset.__getitem__. The __getitem__ method is not creating the indices, but consuming them.
Could you describe the issue a bit more, in particular where the indices are coming from?