I’m learning about autograd. Now I know that in y=a*b, y.backward() calculate the gradient of a and b, and it relies on y.grad_fn = MulBackward. Based on this MulBackward, Pytorch knows that dy/da = b and dy/db = a. And we can check the gradient values by a.grad.
My question is that how exactly different grad_fn (e.g., AddBackward, MulBackward…) calculates the gradients? Thanks.