a = torch.tensor([1,2,3.], requires_grad = True)
out = a.sigmoid()
c = out.data
c.fill_(6)
out.sum().backward()
a.grad

>>> a.grad  # The result is very, very wrong because `out` changed!
tensor([-30., -30., -30.])

I know the result of a.grad is wrong. but now, I want to know how to get the tensor ([-30,-30,30]). I want to how to calculate the result to better understand the principle of autograd.