I had a trivial/simple script and it says the gradients are None:
def check3():
x = Variable( torch.FloatTensor(1).fill_(3), requires_grad=True)
y = 2*x
y = y + y
y.backward()
print(f'y.grad={y.grad}')
gives:
y.grad=None
why?