the first model will be trained on different loss the second model. so I don’t need to retain the gradient.
The idea is to run the model for the first time and optimize its parameters then run it again using the output of the first run and optimize its parameters that are not calculated on the unfolded model between the two runs.