When you do:
input = Variable(torch.rand(1, 3, 224, 224), requires_grad = True).cuda();

You first create a Variable for which gradients should be computed, then create another Variable on the gpu with the same content and store it in input.
This means that the Variable stored in input won’t have gradients computed.
Use:
input = Variable(torch.rand(1, 3, 224, 224).cuda(), requires_grad = True);

or
input = Variable(torch.rand(1, 3, 224, 224), requires_grad = True);
cuda_input = input.cuda()
# Use cuda_input for your net
# Use input to check the gradients