Skip to content

Commit 60ab93a

Browse files
vinhngxnarendasan
authored andcommitted
edit notebook
Signed-off-by: Vinh Nguyen <[email protected]>
1 parent 3d8003c commit 60ab93a

File tree

3 files changed

+9
-105
lines changed

3 files changed

+9
-105
lines changed

Dockerfile.notebook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ RUN bazel build //:libtrtorch --compilation_mode opt
1818
WORKDIR /workspace/TRTorch/py
1919
RUN python3 setup.py install
2020

21-
21+
WORKDIR /workspace/TRTorch/notebooks

notebooks/LeNet-example.ipynb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,11 @@
232232
"cell_type": "markdown",
233233
"metadata": {},
234234
"source": [
235-
"### Tracing"
235+
"When compiling your module to TorchScript, there are two paths: Tracing and Scripting. \n",
236+
" \n",
237+
"### Tracing\n",
238+
"\n",
239+
"Tracing follows the path of execution when the module is called and records what happens. This recording is what the TorchScript IR will describe. To trace an instance of our LeNet module, we can call torch.jit.trace with an example input. "
236240
]
237241
},
238242
{
@@ -300,7 +304,9 @@
300304
"cell_type": "markdown",
301305
"metadata": {},
302306
"source": [
303-
"### Scripting"
307+
"### Scripting\n",
308+
"\n",
309+
"Scripting actually inspects your code with a compiler and generates an equivalent TorchScript program. The difference is that since tracing simply follows the execution of your module, it cannot pick up control flow for instance, it will only follow the code path that a particular input triggers. By working from the Python code, the compiler can include these components. We can run the script compiler on our LeNet module by calling torch.jit.script.\n"
304310
]
305311
},
306312
{

notebooks/WORKSPACE

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)