Thanks for the reply.
I have the same problem as the OP had, but I still don’t understand how to gain more SPEEED in a dataloader work process 
You told OP to shuffle before hand and just do a normal slicing and I have some questions:

How do you effectively shuffle a tensor, or a (data,label)  pair tensor?
In what cases one should use Dataloaders and not custom batch generator function?