Solved by albanD in post #2 
              
              
                Hi, 
There are two things: 

create_graph=True means that you want the graph to be created while doing the backward so that the gradients have requires_grad=True.
retain_graph=True means that you don’t want the graph to be deleted because you want to call backward on it again.

Note that create_grap…