I assume you have to split your dataset into train test and valid format
for that instead of doing it with the dataloader you have to do it beforehand
# scikit learns train test split 
from sklearn.model_selection import train_test_split

# I assume you are having some x , y formatted labels 
X_train , y_train = train_test_split(X,y)
# here you can also give out percentage of train and test split 
# you have default as 80% of data for train and 20% of data for test 


more about train test split
  
      

      scikit-learn
  

  
    

sklearn.model_selection.train_test_split 2

  Examples using sklearn.model_selection.train_test_split: Release Highlights for scikit-learn 0.23 Release Highlights for scikit-learn 0.23, Release Highlights for scikit-learn 0.24 Release Highligh...


  

  
    
    
  

  


splitting the dataset into train_test_and split beforehand is good way 
enjoy coding