It is my Final attempt:
    [train_D, valid_D,train_L,valid_L]= train_test_split(WholeData.numpy(),WholeTargetArray, test_size=0.2,train_size=0.8, shuffle=True, stratify=WholeTargetArray)
   
    DatasetTrain = TensorDataset(torch.from_numpy(train_D),torch.from_numpy(train_L))
        
    DatasetValid=TensorDataset(torch.from_numpy(valid_D),torch.from_numpy(valid_L))

    trainloader=torch.utils.data.DataLoader(DatasetTrain,batch_size=32,shuffle=True,drop_last=True, num_workers=0)

    validationloader=torch.utils.data.DataLoader(DatasetValid, batch_size=6, drop_last=True,num_workers=0)

I think it is correct. What do you think?