Solved by albanD in post #2 
              
              
                Hi, 
I think you’re missing a create_graph=True in the first backward if you want to be able to backprop through the backward pass. 
Also pytorch’s optimizers are not differentiable (yet). So you won’t be able to backprop through that step either. 
I would recommend using the higher package to do th…