The typical way you would go about it is:
for data in dataloader:
    data = data.to(device) # send to cuda 

if you want to access function within your dataset from your data loader
yourdataloader.dataset.<your function / dataset attributes here>

you can send your data to ‘cuda’ but not your dataset class to cuda.