Solved by albanD in post #2 
              
              
                Hi, 
The optimizer step done with pytorch optimizers are not differentiable I’m afraid. So the gradient won’t be able to flow all the way back. You can check the higher library here to see how they do this using their custom differentiable optimizers. 
Also you should not use .data. If you want to u…