@@ -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 >`_
132132on 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") ``
138138We have now officially left the realm of Python and are ready to cross over to the sphere
139139of 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
292292to 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
300301Step 4: Executing the Script Module in C++
0 commit comments