Wei_Chen:

train_loader = DataLoader(dataset, batch_size=5000, shuffle=True, drop_last=False)


@ptrblck
is there a way to give the whole dataloader to gpu (if it has enough memory) after we get our dataloader like this:

train_loader = DataLoader(dataset, batch_size=5000, shuffle=True, drop_last=False)

I am gonna iterate through train_loader and do batch.to(device) every iteration.
is there a way to move all data to gpu so I dont have to do .to(device) in iteration?