Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/_static/css/tvm_theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.rst-content .hidden-section {
display: none;
}

.rst-toc .hidden-section {
display: none;
}

nav .hidden-section {
display: inherit;
}
5 changes: 5 additions & 0 deletions docs/api/python/build.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tvm.build
---------
.. autofunction:: tvm.lower

.. autofunction:: tvm.build
6 changes: 6 additions & 0 deletions docs/api/python/collection.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tvm.collections
---------------
Collections contains data structures used in TVM DSL.

.. automodule:: tvm.collections
:members:
65 changes: 65 additions & 0 deletions docs/api/python/dev.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Developer API
-------------
This page contains modules that are used by developers of TVM.

tvm.node
~~~~~~~~
Node is the base class of all TVM AST. Normally user do not
need to touch this api.

.. autoclass:: tvm.node.NodeBase
:members:

.. autoclass:: tvm.node.Node
:members:

.. autofunction:: tvm.register_node

tvm.expr
~~~~~~~~
.. automodule:: tvm.expr
:members:
:undoc-members:

tvm.codegen
~~~~~~~~~~~
.. automodule:: tvm.codegen
:members:
:undoc-members:

tvm.stmt
~~~~~~~~
.. automodule:: tvm.stmt
:members:
:undoc-members:

tvm.ir_pass
~~~~~~~~~~~
.. automodule:: tvm.ir_pass
:members:

.. autosummary::

tvm.ir_pass.Inline
tvm.ir_pass.Simplify
tvm.ir_pass.ConvertSSA
tvm.ir_pass.VerifySSA
tvm.ir_pass.CanonicalSimplify
tvm.ir_pass.StorageFlatten
tvm.ir_pass.VectorizeLoop
tvm.ir_pass.UnrollLoop
tvm.ir_pass.StorageSync
tvm.ir_pass.MakeAPI
tvm.ir_pass.SplitHostDevice
tvm.ir_pass.InjectVirtualThread
tvm.ir_pass.LoopPartition
tvm.ir_pass.RemoveNoOp
tvm.ir_pass.SplitPipeline
tvm.ir_pass.LowerThreadAllreduce
tvm.ir_pass.NarrowChannelAccess


tvm.make
~~~~~~~~
.. automodule:: tvm.make
:members:
7 changes: 7 additions & 0 deletions docs/api/python/function.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tvm.Function
------------
.. autoclass:: tvm.Function

.. autofunction:: tvm.register_func

.. autofunction:: tvm.get_global_func
16 changes: 16 additions & 0 deletions docs/api/python/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Python API
==========

.. toctree::
:maxdepth: 2

tvm
tensor
schedule
build
module
ndarray
collection
node
function
dev
9 changes: 9 additions & 0 deletions docs/api/python/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tvm.module
----------
.. autoclass:: tvm.module.Module
:members:
:inherited-members:

.. autofunction:: tvm.module.load

.. autofunction:: tvm.module.enabled
16 changes: 16 additions & 0 deletions docs/api/python/ndarray.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
tvm.ndarray
-----------
tvm.ndarray provides a minimum runtime array API to testing out
the correctness of the program.

.. autoclass:: tvm.ndarray.TVMContext
:members:

.. autoclass:: tvm.ndarray.NDArray
:members:
:inherited-members:

.. autofunction:: tvm.cpu
.. autofunction:: tvm.gpu
.. autofunction:: tvm.opencl
.. autofunction:: tvm.ndarray.array
17 changes: 17 additions & 0 deletions docs/api/python/schedule.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
tvm.schedule
------------
The `tvm.schedule` module contains classes of scheduling
structure of tvm.

.. autoclass:: tvm.schedule.IterVar
:members:

.. autofunction:: tvm.create_schedule

.. autoclass:: tvm.schedule.Schedule
:members:
:inherited-members:

.. autoclass:: tvm.schedule.Stage
:members:
:inherited-members:
28 changes: 28 additions & 0 deletions docs/api/python/tensor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
tvm.tensor
----------
The `tvm.tensor` module contains declaration of Tensor
and Operation class for computation declaration.

.. autoclass:: tvm.tensor.Tensor
:members:
:inherited-members:

.. autoclass:: tvm.tensor.Operation
:members:
:inherited-members:

.. autoclass:: tvm.tensor.ComputeOp
:members:
:show-inheritance:

.. autoclass:: tvm.tensor.PlaceholderOp
:members:
:show-inheritance:

.. autoclass:: tvm.tensor.ScanOp
:members:
:show-inheritance:

.. autoclass:: tvm.tensor.ExternOp
:members:
:show-inheritance:
40 changes: 40 additions & 0 deletions docs/api/python/tvm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
tvm
---
tvm is a library root namespace contains functions for
declaring computation.

.. autosummary::

tvm.load_json
tvm.save_json
tvm.var
tvm.const
tvm.convert
tvm.placeholder
tvm.compute
tvm.scan
tvm.extern
tvm.call_packed
tvm.decl_buffer
tvm.reduce_axis
tvm.thread_axis
tvm.sum
tvm.min
tvm.max

.. autofunction:: tvm.load_json
.. autofunction:: tvm.save_json
.. autofunction:: tvm.var
.. autofunction:: tvm.const
.. autofunction:: tvm.convert
.. autofunction:: tvm.placeholder
.. autofunction:: tvm.compute
.. autofunction:: tvm.scan
.. autofunction:: tvm.extern
.. autofunction:: tvm.call_packed
.. autofunction:: tvm.decl_buffer
.. autofunction:: tvm.reduce_axis
.. autofunction:: tvm.thread_axis
.. autofunction:: tvm.sum
.. autofunction:: tvm.min
.. autofunction:: tvm.max
34 changes: 25 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
libpath = os.path.join(curr_path, '../python/')
sys.path.insert(0, libpath)


# -- General configuration ------------------------------------------------

# General information about the project.
Expand All @@ -51,11 +50,15 @@
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx.ext.mathjax',
'sphinx_gallery.gen_gallery',
]

breathe_projects = {'tvm' : 'doxygen/xml/'}
breathe_default_project = 'tvm'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down Expand Up @@ -132,7 +135,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
html_static_path = ['_static']

# Output file base name for HTML help builder.
htmlhelp_basename = project + 'doc'
Expand All @@ -153,12 +156,19 @@
def run_doxygen(folder):
"""Run the doxygen make command in the designated folder."""
try:
retcode = subprocess.call("cd %s; make doxygen" % folder, shell=True)
retcode = subprocess.call("cd %s; make doc" % folder, shell=True)
if retcode < 0:
sys.stderr.write("doxygen terminated by signal %s" % (-retcode))
except OSError as e:
sys.stderr.write("doxygen execution failed: %s" % e)

intersphinx_mapping = {
'python': ('https://docs.python.org/{.major}'.format(sys.version_info), None),
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
'scipy': ('http://docs.scipy.org/doc/scipy/reference', None),
'matplotlib': ('http://matplotlib.org/', None),
}

examples_dirs = ['../tutorials/python']
gallery_dirs = ['tutorials']

Expand All @@ -171,18 +181,24 @@ def generate_doxygen_xml(app):
def setup(app):
# Add hook for building doxygen xml when needed
# no c++ API for now
# app.connect("builder-inited", generate_doxygen_xml)
app.connect("builder-inited", generate_doxygen_xml)
app.add_stylesheet('css/tvm_theme.css')
app.add_config_value('recommonmark_config', {
'url_resolver': lambda url: github_doc_root + url,
}, True)
app.add_transform(AutoStructify)


sphinx_gallery_conf = {
'backreferences_dir': 'gen_modules/backreferences',
'doc_module': ('tvm'),
'reference_url': {
'tvm': None
},
'doc_module': ('tvm', 'numpy'),
'reference_url': {
'tvm': None,
'matplotlib': 'http://matplotlib.org',
'numpy': 'http://docs.scipy.org/doc/numpy-1.9.1'},
'examples_dirs': examples_dirs,
'gallery_dirs': gallery_dirs
'gallery_dirs': gallery_dirs,
'find_mayavi_figures': False,
'filename_pattern': '.py',
'expected_failing_examples': []
}
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Contents
.. toctree::
:maxdepth: 1

how_to/contribute
how_to/install
tutorials/index
python/api
api/python/index
how_to/contribute
Loading