PyTorch · Method
model.load_state_dict
model.load_state_dict restores a PyTorch module from a deserialized state dictionary. Create the model first, load the dictionary with torch.load(), then pass it to this method.
Last updated
Syntax
model.load_state_dict(state_dict, strict=True)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
torch.savetorch.loadtorch.nn.Module.state_dictmodel.evalmodel.train