Skip to content
masterclass Buddy

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.

Subscribe
  • torch.save
  • torch.load
  • torch.nn.Module.state_dict
  • model.eval
  • model.train

Source: Saving and Loading Models — PyTorch Tutorials 2.15.0+cu132 documentation. Checked 2026-11-03.