Skip to content

Commit

Permalink
Fix usage of correct ScriptModule (pytorch#740)
Browse files Browse the repository at this point in the history
Co-authored-by: holly1238 <[email protected]>
  • Loading branch information
stante and holly1238 authored Apr 18, 2021
1 parent 0445e9c commit 82dbee9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions advanced_source/cpp_export.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ If you need to exclude some methods in your ``nn.Module``
because they use Python features that TorchScript doesn't support yet,
you could annotate those with ``@torch.jit.ignore``

``my_module`` is an instance of
``sm`` is an instance of
``ScriptModule`` that is ready for serialization.

Step 2: Serializing Your Script Module to a File
Expand All @@ -132,7 +132,7 @@ on the module and pass it a filename::
traced_script_module.save("traced_resnet_model.pt")

This will produce a ``traced_resnet_model.pt`` file in your working directory.
If you also would like to serialize ``my_module``, call ``my_module.save("my_module_model.pt")``
If you also would like to serialize ``sm``, call ``sm.save("my_module_model.pt")``
We have now officially left the realm of Python and are ready to cross over to the sphere
of C++.

Expand Down

0 comments on commit 82dbee9

Please sign in to comment.