I set my model and data to the same device,
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") net.to(device)