Solved by ptrblck in post #2 
              
              
                You could manually shuffle the indices using: 
indices = torch.randperm(len(train_dataset))[:3000]

and pass these indices to a RandomSubsetSampler, which can then be passed to the DataLoader.