title: How do I save a trained model in PyTorch?
body: <p>How do I save a trained model in PyTorch? I have read that:</p>
  <ol>
  <li><a href="https://github.com/torch/torch7/blob/master/doc/serialization.md#torchsavefilename-object--format-referenced" rel="noreferrer"><code>torch.save()</code></a>/<a href="https://github.com/torch/torch7/blob/master/doc/serialization.md#object-torchloadfilename--format-referenced" rel="noreferrer"><code>torch.load()</code></a> is for saving/loading a serializable object.</li>
  <li><a href="http://pytorch.org/docs/nn.html#torch.nn.Module.state_dict" rel="noreferrer"><code>model.state_dict()</code></a>/<a href="http://pytorch.org/docs/nn.html#torch.nn.Module.load_state_dict" rel="noreferrer"><code>model.load_state_dict()</code></a> is for saving/loading model state.</li>
  </ol>