Just output from
for x, y in train_loader:
    x  = x.to(device)
    y = y.to(device)
    # Rest of training loop

Is enough to move the data to GPU and train with it, you don’t need to put it into a list and then later use it it is not a right move as all data will be in your memory and the whole point of batches will be ruined!