Yep, that is what I have done above. I used SubsetRandomSampler and generated random indexes to match the size I wanted. I wanted to know if there was an efficient way to generate unique random indexes to pass to SubsetRandomSampler .