Hi all,
Suppose my my input img is processed by adding noise (noisy_img) before feed into model, when I tried gradients = autograd.grad(outputs=output, inputs=img)  I can’t get the gradient. But if I use gradients = autograd.grad(outputs=output, inputs=noisy_img) , it seems working without error. I set both img and noisy_img requires_grad=True.
What’s the proper way to get the gradients of output w.r.t. img in this case?
Thank you.