What do you mean? I don’t think that’s what it does.
Assume that you have some input and a function f such that f(input) = output
The gradient you pass to output.backward() is the “gradient of the output”. What happens with backpropagation is that we use the gradient of the output to compute the gradient of the input.