I have a trained model, and I’m trying to retrieval gradients of the output w.r.t some new input. I set the input.requires_grad = True in advance. Now I’m using autograd.grad(output, input, retain_graph=True) to get gradients. However, with the same code, if I ran multiple times, I get slightly different result every time. And after a certain number of runs, the result stopped changing. Why is this happening? Am I doing something wrong? Thank you!