LeErnst:

Okay, so it is a PyTorch internal thing?


What do you mean by that?



 LeErnst:

Because i think that i do not need to redefine the closure function. The closure uses self.model which is a reference to model and whenever i change the object under the name self.model the closure function evaluates the new assigned model.


I don’t know, how you’ve defined the closure method, but if it’s just using some objects, there would be no need to redefine it.