Commit f4a15334 by Tianqi Chen Committed by GitHub

[DOC] move comments to file header (#91)

parent b8234498
...@@ -8,5 +8,9 @@ ...@@ -8,5 +8,9 @@
[Release Notes](NEWS.md) [Release Notes](NEWS.md)
# TVM # TVM
TVM is a domain specific language(DSL) for tensor computations. TVM is a low level domain specific language(DSL) for compiling tensor computation pipelines.
The goal of the project is to generate efficient kernels for deep learning workloads. It is designed to compile multi-dimensional tensor algebra pipelines which
are crucial to deep learning frameworks.
## Documentation
The current documentation can be build locally via sphinx. See [docs](docs) folder for details.
tvm.collections tvm.collections
--------------- ---------------
Collections contains data structures used in TVM DSL.
.. automodule:: tvm.collections .. automodule:: tvm.collections
:members: :members:
Developer API Developer API
------------- -------------
This page contains modules that are used by developers of TVM. This page contains modules that are used by developers of TVM.
Many of these APIs are PackedFunc registered in C++ backend.
tvm.node tvm.node
~~~~~~~~ ~~~~~~~~
Node is the base class of all TVM AST. Normally user do not .. automodule:: tvm.node
need to touch this api.
.. autoclass:: tvm.node.NodeBase .. autoclass:: tvm.node.NodeBase
:members: :members:
......
...@@ -11,6 +11,5 @@ Python API ...@@ -11,6 +11,5 @@ Python API
module module
ndarray ndarray
collection collection
node
function function
dev dev
tvm.module tvm.module
---------- ----------
.. autoclass:: tvm.module.Module .. automodule:: tvm.module
:members: :members:
:inherited-members:
.. autofunction:: tvm.module.load
.. autofunction:: tvm.module.enabled
tvm.ndarray tvm.ndarray
----------- -----------
tvm.ndarray provides a minimum runtime array API to testing out .. automodule:: tvm.ndarray
the correctness of the program.
.. autoclass:: tvm.ndarray.TVMContext .. autoclass:: tvm.ndarray.TVMContext
:members: :members:
......
tvm.schedule tvm.schedule
------------ ------------
The `tvm.schedule` module contains classes of scheduling .. automodule:: tvm.schedule
structure of tvm.
.. autoclass:: tvm.schedule.IterVar .. autoclass:: tvm.schedule.IterVar
:members: :members:
......
tvm.tensor tvm.tensor
---------- ----------
The `tvm.tensor` module contains declaration of Tensor .. automodule:: tvm.tensor
and Operation class for computation declaration.
.. autoclass:: tvm.tensor.Tensor .. autoclass:: tvm.tensor.Tensor
:members: :members:
......
tvm tvm
--- ---
tvm is a library root namespace contains functions for The user facing API for computation declaration.
declaring computation.
.. autosummary:: .. autosummary::
......
...@@ -156,7 +156,10 @@ latex_documents = [ ...@@ -156,7 +156,10 @@ latex_documents = [
def run_doxygen(folder): def run_doxygen(folder):
"""Run the doxygen make command in the designated folder.""" """Run the doxygen make command in the designated folder."""
try: try:
retcode = subprocess.call("cd %s; make doc" % folder, shell=True) #retcode = subprocess.call("cd %s; make doc" % folder, shell=True)
retcode = subprocess.call("rm -rf _build/html/doxygen", shell=True)
retcode = subprocess.call("mkdir -p _build/html", shell=True)
retcode = subprocess.call("cp -rf doxygen/html _build/html/doxygen", shell=True)
if retcode < 0: if retcode < 0:
sys.stderr.write("doxygen terminated by signal %s" % (-retcode)) sys.stderr.write("doxygen terminated by signal %s" % (-retcode))
except OSError as e: except OSError as e:
...@@ -174,9 +177,7 @@ gallery_dirs = ['tutorials'] ...@@ -174,9 +177,7 @@ gallery_dirs = ['tutorials']
def generate_doxygen_xml(app): def generate_doxygen_xml(app):
"""Run the doxygen make commands if we're on the ReadTheDocs server""" """Run the doxygen make commands if we're on the ReadTheDocs server"""
read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True' run_doxygen('..')
if read_the_docs_build:
run_doxygen('..')
def setup(app): def setup(app):
# Add hook for building doxygen xml when needed # Add hook for building doxygen xml when needed
......
...@@ -9,7 +9,9 @@ Contents ...@@ -9,7 +9,9 @@ Contents
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
self
how_to/install how_to/install
tutorials/index tutorials/index
api/python/index api/python/index
how_to/contribute how_to/contribute
genindex
# pylint: disable=redefined-builtin, wildcard-import # pylint: disable=redefined-builtin, wildcard-import
"""C++ backend related python scripts""" """TVM: a DSL for tensor kernel compilation"""
from __future__ import absolute_import as _abs from __future__ import absolute_import as _abs
from . import tensor from . import tensor
......
"""The build pipeline in python. """The build utils in python.
Eventually some of these pipelines will be moved to C++. This module provides the functions to transform schedule to
But the first pipeline will be kept in python for ease of change and evolving. LoweredFunc and compiled Module.
""" """
from __future__ import absolute_import as _abs
from . import api from . import api
from . import tensor from . import tensor
from . import schedule from . import schedule
......
"""Collection structure in the high level DSL.""" """Collections contains data structures used in TVM DSL."""
from __future__ import absolute_import as _abs from __future__ import absolute_import as _abs
from ._ctypes._node import NodeBase, register_node from ._ctypes._node import NodeBase, register_node
from . import _api_internal from . import _api_internal
......
"""Runtime module related stuffs""" """Container of compiled functions of TVM."""
from __future__ import absolute_import as _abs from __future__ import absolute_import as _abs
from ._ctypes._function import ModuleBase, _init_module_module from ._ctypes._function import ModuleBase, _init_module_module
from ._ctypes._function import _init_api from ._ctypes._function import _init_api
...@@ -21,6 +21,11 @@ class Module(ModuleBase): ...@@ -21,6 +21,11 @@ class Module(ModuleBase):
---------- ----------
fmt : str, optional fmt : str, optional
The specified format. The specified format.
Returns
-------
source : str
The result source code.
""" """
return _GetSource(self, fmt) return _GetSource(self, fmt)
......
"""TVM Runtime API. """TVM Runtime NDArray API.
This is a simplified runtime API for quick testing and proptyping. tvm.ndarray provides a minimum runtime array API to test
the correctness of the program.
""" """
# pylint: disable=invalid-name,unused-import # pylint: disable=invalid-name,unused-import
from __future__ import absolute_import as _abs from __future__ import absolute_import as _abs
......
"""Namespace for base node class""" """Node is the base class of all TVM AST.
Normally user do not need to touch this api.
"""
# pylint: disable=unused-import # pylint: disable=unused-import
from __future__ import absolute_import as _abs from __future__ import absolute_import as _abs
from ._ctypes._node import NodeBase, register_node from ._ctypes._node import NodeBase, register_node
......
"""Collection structure in the high level DSL.""" """The computation schedule api of TVM."""
from __future__ import absolute_import as _abs from __future__ import absolute_import as _abs
from ._ctypes._node import NodeBase, register_node from ._ctypes._node import NodeBase, register_node
from . import _api_internal from . import _api_internal
......
"""Tensor and Computation abstraction objects""" """Tensor and Operation class for computation declaration."""
# pylint: disable=invalid-name # pylint: disable=invalid-name
from __future__ import absolute_import as _abs from __future__ import absolute_import as _abs
from ._ctypes._node import NodeBase, SliceBase, register_node, convert_to_node from ._ctypes._node import NodeBase, SliceBase, register_node, convert_to_node
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment