How would we do the same when we use sampler=torch.utils.data.SubsetRandomSampler() when creating the dataloader?
indices = np.arange(0, len(dataset))
train_dl = DataLoader(dataset, bs, sampler=torch.utils.data.SubsetRandomSampler(indices[:300]))
test_dl  = DataLoader(dataset, bs, sampler=torch.utils.data.SubsetRandomSampler(indices[-300:]))

len(train_dl.dataset) == len(test_dl.dataset)