Solved by ptrblck in post #2 
              
              
                If you want to randomly split your Dataset, you could use torch.utils.data.random_split. 
Alternatively, if you want to apply a stratified split, you could use sklearn.model_selection.train_test_split and pass the targets as the stratify argument.