Thanks @G.M, but that is the opposite of what I’m asking. I want to repeatedly reset the parameters of a ‘learner’ model each iteration during training by a ‘metalearner’. Using data or no_grad doesn’t allow gradient to pass back to the metalearner parameters, which is what I’m looking to do.