Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix static_graph docs code examples #7875

Merged
merged 1 commit into from Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/source/reference/static_graph.rst
Expand Up @@ -28,7 +28,9 @@ The first step is to import the necessary packages:

.. literalinclude:: ../../../examples/static_graph_optimizations/mnist/train_mnist.py
:language: python
:lines: 15-16
:linenos:
:lines: 24-25
:lineno-start: 24
:caption: train_mnist.py

Since the neural network model ``MLP`` corresponds to a static graph, we can annotate it as a static graph by
Expand All @@ -39,7 +41,9 @@ the documentation.

.. literalinclude:: ../../../examples/static_graph_optimizations/mnist/train_mnist.py
:language: python
:lines: 22-41
:linenos:
:lines: 34-53
:lineno-start: 34
:caption: train_mnist.py

.. note::
Expand Down
6 changes: 6 additions & 0 deletions examples/static_graph_optimizations/mnist/train_mnist.py
Expand Up @@ -4,7 +4,13 @@
to support the static subgraph optimizations feature. Note that
the code is mostly unchanged except for the addition of the
`@static_graph` decorator to the model chain's `__call__()` method.

Note for contributors:
This example code is referred to from the documentation.
If this file is to be modified, please also update the line numbers in
`docs/source/reference/static_graph.rst` accordingly.
"""

from __future__ import print_function

import argparse
Expand Down