Solved by ptrblck in post #2 
              
              
                There are different way of handling this use case. 
The simplest would be to load the complete data into memory and just use some conditions on the index to select the right numpy array where the current sample is located to load it. 
The other approach would be to create a separate Dataset for each…