Solved by ptrblck in post #2 
              
              
                y depends on x - the output of model1. 
If you call loss2.backward() Autograd tries to calculate the gradients using the computation graph. 
Since model2 and model1 are connected through x, Autograd also tries to calculate the gradients again for the parameters in model1. 
So save memory, the interm…