Hi, I am a newbie to PyTorch and have a question about autograd. I am following a tutorial like this to calculate the gradients. :
x = torch.randn(2,2, requires_grad=True)
y = x**2
z = y.mean()
z.backward()
print(x.grad)

But when I run:
y.backward()

Error appears! So why is it not allowed to use .backward() on tensor y？