Hello all, I’m new to using neural network libraries, so I’m sorry if this is  a stupid question. I have a pretrained network with a 28x28 input(MNIST) image and 10 outputs. I want to get the gradient of one of those outputs wrt the input.
To do this, I do one forward pass by doing output=net(input), where input is a variable with requires_grad=True. After this, I want to do a backward pass, but the pass requires a vector as the input. Does this vector list a kind of weight list where the gradients of different outputs are summed? In particular, since the gradient of only one of those outputs, should I use output.backward([0,0,0,1,0,...,0]) or something else?
Thank you very much in advance!