Assume that I save a model using torch.save('model.pt'). After the save, I add a new function to the model class in the source code, say new_feature(self, batch).
After this, if I do model = torch.load('model.pt'), I get a few warnings about the source code change. but I can surprisingly also use the new_feature() in the loaded model (that was serialized before the new_feature was added).
In this case, does torch.load() only load the parameters from model.pt? My understanding about serialization was that the entire model object will be dumped and not just the parameters. Can some one please shed some light on this topic for me?
Much appreciated.