My example return one sample sequentially instead of a pair.
One exemplary output would be:
tensor([32.])
tensor([33.])
tensor([21.])
tensor([22.])
tensor([12.])
tensor([13.])
tensor([11.])
tensor([12.])
tensor([22.])
tensor([23.])
tensor([31.])
tensor([32.])

For this approach you would need all data to be shuffled individually and not as pairs.
Would this be possible?
Regarding the invalid indices, could you calculate them automatically using your file names and a regular expression?