Take a look at this post 6 to check how the BatchSampler could work (it’ll pass a batch of indices to the __getitem__ method). To do so, you could create a custom sampling strategy in a derived sampler class and create the batch of indices here 2.
Let me know, if you get stuck and I can try to follow up with an example code snippet.