When I do not have .cuda activated, I do not get any error when I call
 out.backward(torch.ones(output.size()))

But when i state that the model is in cuda, then this throws an error stating invalid combination of arguments.
model.cuda()
......
......
out.backward(torch.ones(output.size())

How do I fix this issue?