Solved by ptrblck in post #2 
              
              
                The manual loop might be faster, since you are just slicing the tensor, while your Dataset copies the data. 
Try to use torch.from_numpy in your __getitem__ and compare the results again.