Skip to content

Commit 747b3bc

Browse files
committed
more clarifications
1 parent 0cf0c68 commit 747b3bc

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

advanced_source/cpp_export.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ earlier in the tracing example. To perform this serialization, simply call
131131
`save <https://pytorch.org/docs/master/jit.html#torch.jit.ScriptModule.save>`_
132132
on the module and pass it a filename::
133133

134-
my_module.save("custom_model.pt")
134+
traced_script_module.save("traced_resnet_model.pt")
135135

136-
This will produce a ``custom_model.pt`` file in your working directory.
137-
If you also would like to save our traced version of ``ResNet18``, call ``traced_script_module.save("traced_resnet_model.pt")``
136+
This will produce a ``traced_resnet_model.pt`` file in your working directory.
137+
If you also would like to serialize ``my_module``, call ``my_module.save("my_module_model.pt")``
138138
We have now officially left the realm of Python and are ready to cross over to the sphere
139139
of C++.
140140

@@ -288,13 +288,14 @@ distribution. If all goes well, it will look something like this:
288288
[100%] Linking CXX executable example-app
289289
[100%] Built target example-app
290290
291-
If we supply the path to the serialized custom model ``custom_model.pt`` we created earlier
291+
If we supply the path to the traced ``ResNet18`` model ``traced_resnet_model.pt`` we created earlier
292292
to the resulting ``example-app`` binary, we should be rewarded with a friendly
293-
"ok":
293+
"ok". Please note, if try to run this example with ``my_module_model.pt`` you will get an error saying that
294+
your input is of an incompatible shape. ``my_module_model.pt`` expects 1D instead of 4D.
294295
295296
.. code-block:: sh
296297
297-
root@4b5a67132e81:/example-app/build# ./example-app <path_to_model>/custom_model.pt
298+
root@4b5a67132e81:/example-app/build# ./example-app <path_to_model>/traced_resnet_model.pt
298299
ok
299300
300301
Step 4: Executing the Script Module in C++

0 commit comments

Comments
 (0)