Skip to content

Commit ecbeae4

Browse files
committed
address comments
1 parent e0f26a8 commit ecbeae4

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

beginner_source/deploy_seq2seq_hybrid_frontend_tutorial.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# regarding data preprocessing, model theory and definition, and model
1919
# training.
2020
#
21-
# What is the TorchScript?
21+
# What is TorchScript?
2222
# ----------------------------
2323
#
2424
# During the research and development phase of a deep learning-based
@@ -53,12 +53,12 @@
5353
# will be recorded. In other words, the control flow itself is not
5454
# captured. To convert modules and functions containing data-dependent
5555
# control flow, a **scripting** mechanism is provided. The
56-
# ``torch.jit.script`` function takes module or function and does not
57-
# requires example inputs. Scripting then explicitly converts the module
58-
# or function code to TorchScript, including all possible control flow
59-
# routes. The one caveat with using scripting is that it only supports
60-
# a subset of Python, so you might need to rewrite the code to make it
61-
# compatible with TorchScript syntax.
56+
# ``torch.jit.script`` function/decorator takes a module or function and
57+
# does not requires example inputs. Scripting then explicitly converts
58+
# the module or function code to TorchScript, including all control flows.
59+
# One caveat with using scripting is that it only supports a subset of
60+
# Python, so you might need to rewrite the code to make it compatible
61+
# with the TorchScript syntax.
6262
#
6363
# For all details relating to the supported features, see the TorchScript
6464
# `language reference <https://pytorch.org/docs/master/jit.html>`__. To
@@ -385,7 +385,7 @@ def forward(self, hidden, encoder_outputs):
385385
# TorchScript Notes:
386386
# ~~~~~~~~~~~~~~~~~~~~~~
387387
#
388-
# Similarly to the ``EncoderRNN```, this module does not contain any
388+
# Similarly to the ``EncoderRNN``, this module does not contain any
389389
# data-dependent control flow. Therefore, we can once again use
390390
# **tracing** to convert this model to TorchScript after it
391391
# is initialized and its parameters are loaded.
@@ -692,7 +692,7 @@ def evaluateExample(sentence, searcher, voc):
692692
# for some part of your models, you must call .to(device) to set the device
693693
# options of the models and .eval() to set the dropout layers to test mode
694694
# **before** tracing the models. `TracedModule` objects do not inherit the
695-
# ``to``` or ``eval``` methods. Since in this tutorial we are only using
695+
# ``to`` or ``eval`` methods. Since in this tutorial we are only using
696696
# scripting instead of tracing, we only need to do this before we do
697697
# evaluation (which is the same as we normally do in eager mode).
698698
#

0 commit comments

Comments
 (0)