Because the graph we were talking about above is the graph to compute gradients.

I still have a hard time getting my head around this … So I write a easy example as below and hope can get some feedback from you!
a = torch.tensor(1., requires_grad=True)
b = torch.tensor(2.,requires_grad= True)
c = a*b 

To my understanding , the graph would be created since c =a*b 
for _ in range(5):
    print(c.backward(retain_graph=True))
    print(a.grad,b.grad)

The result
None
tensor(2.) tensor(1.)
None
tensor(4.) tensor(2.)
None
tensor(6.) tensor(3.)
None
tensor(8.) tensor(4.)
None
tensor(10.) tensor(5.)

Q1:
Why does print(c.backward(retain_graph=True))gives the None??
As for the explanation you give above:
If the tensor is not part of computing gradient graph ,then we can delete it and backward should work fine  .So,here’s what I do:
del b 
for _ in range(3):
     c.backward(retain_graph = True)
     print(a.grad)

And the result gives ：
tensor(12.)
tensor(14.)
tensor(16.)

The result does’t make sense to me since to my understanding, c =a*b
What I expect is that the c.backward(retain_graph = True) should fail because the b has already been deleted ,what do I miss here?
I think the problem is that I do not know which tensor or function would be considered as the graph to compute gradients,Maybe b here is not ,but I think it should be part of it…
Two questions for you ,I am a beginner of Pytorch and thanks in advance!