Backprop loss to input layer

Hi,
I am building a classification model for images. When I predict the class for a test img (with labels) and calculate the loss, I want to backprop this loss to the input image and calculate the total error at the input layer. Basically, the gradient with respect to the input image.
What kind of parameters can I pass in “learn.backward(item)”? Is this the right way to go about this?