When storing a trained model via torch.save(model, path) the module definition is not stored within the saved file.
This leads to problems when I want to load the pre-trained model from other projects (or with global command line tools). I.e. leading to: ModuleNotFoundError: No module named 'ResNet' when loading with torch.load(path).
Can I store the model definition (i.e. ResNet.py) within the model itself? If yes, how?