Skip to content

Commit

Permalink
Merge pull request #7875 from niboshi/fix-docs-static-graph
Browse files Browse the repository at this point in the history
Fix `static_graph` docs code examples
  • Loading branch information
Crissman committed Aug 8, 2019
2 parents ac25ec5 + 8d17b08 commit bdacd95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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

0 comments on commit bdacd95

Please sign in to comment.