Solved by JuanFMontesinos in post #2 
              
              
                It’s a bit abstract but simple. 
Gradients are accumulative in pytorch. This means unless you call optim.zero_grad() to set gradients to zero, gradients will keep accumulating. 
You need to run both networks, backward pink using retain_graph=True. Then iterate through the gradients (for p in model.p…