Hi,
I am trying to undrestand grad_fn with a simple example, but could not understand it.  Can anyone explain the reason of the output?  Thanks.
x = torch.tensor(2., requires_grad=True)
a = torch.tensor([1.5], requires_grad=True)
y = x**5
print(y.grad_fn(x))
print(y.grad_fn(a))
--------output-------
tensor(160., grad_fn=<MulBackward0>)
tensor([120.], grad_fn=<MulBackward0>)