Hi,
It would be simple enough if you would create a Dataset class:
from torch.utils.data import Dataset

class Dset(Dataset):

    def __init__( self , x_train , transform=True):
        
        self.transform = transform
        self.x=x_train


    def __getitem__(self , index):
         if self.trainsform:
                self.x=torch.from_numpy(self.x)
         return self.x
        

    def __len__(self):
        return len(self.x)

And then use dataloaders like:
train = Dset(x_train)
target = Dset(y_train)
batch_size=128
train_loader = DataLoader(train, batch_size=batch_size,shuffle=False)
target_loader = DataLoader(target, batch_size=batch_size,shuffle=False)

While calling them in for training, try:
for epoch in range(epochs):
       for x_ in train_loader:
           print(type(x_))
           ...