Load model from *.pt with different model definition path

Language: Python
Version: PyTorch 1-6-0

Suppose, a neural network is saved using torch.save(model, "model.pt").

Now, the model definition (source code) is placed somewhere else, so that it cannot find this definition when using torch.load("model.pt").

  1. Is it possible to load model.pt with a different model definition path?
  2. Is it possible to extract the state_dict from model.pt?