Skip to content

Commit 3bee032

Browse files
committed
[TUTORIAL] Move mobilenet to tutorial, fix precompute_prune (#35)
* [TUTORIAL] Move mobilenet to tutorial, fix precompute_prune * Some language improvements
1 parent ae0d16c commit 3bee032

File tree

15 files changed

+271
-135
lines changed

15 files changed

+271
-135
lines changed

nnvm/docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
doxygen
22
_build
3+
gen_modules
4+
tutorials

nnvm/docs/README.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The documentation of nnvm is generated with recommonmark and sphinx.
2+
3+
- pip install sphinx>=1.5.5 sphinx-gallery sphinx_rtd_theme matplotlib Image recommonmark
4+
- Build tvm first in the root folder.

nnvm/docs/conf.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import os, subprocess
1616
import shlex
1717
import recommonmark
18+
import sphinx_gallery
1819
from recommonmark.parser import CommonMarkParser
1920
from recommonmark.transform import AutoStructify
2021

@@ -50,7 +51,8 @@
5051
'sphinx.ext.autosummary',
5152
'sphinx.ext.intersphinx',
5253
'sphinx.ext.napoleon',
53-
'sphinx.ext.mathjax'
54+
'sphinx.ext.mathjax',
55+
'sphinx_gallery.gen_gallery',
5456
]
5557

5658
# Add any paths that contain templates here, relative to this directory.
@@ -129,7 +131,7 @@
129131
# Add any paths that contain custom static files (such as style sheets) here,
130132
# relative to this directory. They are copied after the builtin static files,
131133
# so a file named "default.css" will overwrite the builtin "default.css".
132-
html_static_path = ['_static']
134+
# html_static_path = ['_static']
133135

134136
# Output file base name for HTML help builder.
135137
htmlhelp_basename = project + 'doc'
@@ -164,9 +166,17 @@ def run_doxygen(folder):
164166
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
165167
'scipy': ('http://docs.scipy.org/doc/scipy/reference', None),
166168
'matplotlib': ('http://matplotlib.org/', None),
169+
'tvm': ('http://docs.tvmlang.org/', None),
167170
}
168171

169172

173+
from sphinx_gallery.sorting import ExplicitOrder
174+
175+
examples_dirs = ['../tutorials/']
176+
gallery_dirs = ['tutorials']
177+
178+
subsection_order = ExplicitOrder([])
179+
170180
def generate_doxygen_xml(app):
171181
"""Run the doxygen make commands if we're on the ReadTheDocs server"""
172182
run_doxygen('..')
@@ -180,3 +190,19 @@ def setup(app):
180190
'auto_doc_ref': True
181191
}, True)
182192
app.add_transform(AutoStructify)
193+
194+
195+
sphinx_gallery_conf = {
196+
'backreferences_dir': 'gen_modules/backreferences',
197+
'doc_module': ('tvm', 'nnvm', 'numpy'),
198+
'reference_url': {
199+
'nnvm': None,
200+
'tvm': 'http://docs.tvmlang.org',
201+
'numpy': 'http://docs.scipy.org/doc/numpy-1.9.1'},
202+
'examples_dirs': examples_dirs,
203+
'gallery_dirs': gallery_dirs,
204+
'subsection_order': subsection_order,
205+
'find_mayavi_figures': False,
206+
'filename_pattern': '.py',
207+
'expected_failing_examples': []
208+
}

nnvm/docs/dev/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
NNVM Design Note
2-
================
1+
Design Note
2+
===========
33

44
In this part of documentation, we share the rationale for the specific choices made when designing NNVM.
55

nnvm/docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ Contents
1010

1111
self
1212
top
13+
tutorials/index
1314
dev/index

nnvm/docs/top.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
NNVM Core Tensor Operators
2-
==========================
1+
Core Tensor Operators
2+
=====================
33

44
This page contains the list of core tensor operator primitives re-defined in NNVM.
55
The core tensor operator primitives(``nnvm.top``) covers typical workloads in deep learning.

nnvm/example/mobilenet_inference_gpu.py

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

nnvm/examples/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
NNVM Examples
2+
=============
3+
This folder contains example snippets of running NNVM Compilation.
4+
5+
- See also [Tutorials](tutorials) for tutorials with detailed explainations.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
"""Utilities for testcase"""
1+
"""Utilities for testing and benchmarks"""
2+
from __future__ import absolute_import as _abs
23

34
from .config import ctx_list
5+
from . import mobilenet

nnvm/python/nnvm/testing/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"""Configuration about tests"""
2+
from __future__ import absolute_import as _abs
3+
24
import os
35
import tvm
46

0 commit comments

Comments
 (0)