Thanks for the response.
If I do my_model = model.cuda() I have to do model_input = model_input.cuda(), otherwise I get the following message:
RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #2 'weight'
But if I do:
my_model = DataParallel(model, devices_ids = [torch.cuda.current_device()])
or
my_model = DataParallel(model, devices_ids = [torch.cuda.current_device()]).cuda()
I don’t need to do model_input = model_input.cuda(), it works as well with  model_input = model_input.cpu().