Commit b5702eca by ziheng Committed by GitHub

[DOC] Add setup.py, fix comments (#89)

* Add setup.py, fix comments

* Update installation document
parent ca5929e9
...@@ -67,3 +67,12 @@ There are several ways to install the package: ...@@ -67,3 +67,12 @@ There are several ways to install the package:
```bash ```bash
export PYTHONPATH=/path/to/tvm/python:${PYTHONPATH} export PYTHONPATH=/path/to/tvm/python:${PYTHONPATH}
``` ```
2. Install tvm python bindings by `setup.py`:
```bash
# install tvm package for the current user
cd python; python setup.py install --user
# or install tvm package system wide
cd python; sudo python setup.py install
```
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Setup tvm package."""
from __future__ import absolute_import
import os
import sys
import setuptools
CURRENT_DIR = os.path.dirname(__file__)
libinfo_py = os.path.join(CURRENT_DIR, 'tvm/libinfo.py')
libinfo = {'__file__': libinfo_py}
exec(compile(open(libinfo_py, 'rb').read(), libinfo_py, 'exec'), libinfo, libinfo)
LIB_PATH = libinfo['find_lib_path']()
__version__ = libinfo['__version__']
setuptools.setup(
name='tvm',
version=__version__,
description='A domain specific language(DSL) for tensor computations.',
packages=setuptools.find_packages(),
install_requires=[
'numpy',
],
data_files=[('tvm', [LIB_PATH[0]])]
)
...@@ -292,7 +292,7 @@ def register_func(func_name, f=None): ...@@ -292,7 +292,7 @@ def register_func(func_name, f=None):
func_name : str or function func_name : str or function
The function name The function name
f : function f : function, optional
The function to be registered. The function to be registered.
Returns Returns
......
...@@ -27,14 +27,14 @@ def lower(sch, ...@@ -27,14 +27,14 @@ def lower(sch,
args : list of Buffer or Tensor or Var args : list of Buffer or Tensor or Var
The argument lists to the function. The argument lists to the function.
name : str name : str, optional
The name of result function. The name of result function.
binds : dict, optional binds : dict, optional
Dictionary that maps the binding of symbolic buffer to Tensor. Dictionary that maps the binding of symbolic buffer to Tensor.
By default, a new buffer is created for each tensor in the argument. By default, a new buffer is created for each tensor in the argument.
max_auto_unroll_step: int max_auto_unroll_step: int, optional
Maximum step to perform automatic unrolling Maximum step to perform automatic unrolling
Returns Returns
...@@ -86,26 +86,26 @@ def build(sch, ...@@ -86,26 +86,26 @@ def build(sch,
sch : tvm.Schedule, or LoweredFunc sch : tvm.Schedule, or LoweredFunc
The schedule to be builded The schedule to be builded
args : list of Buffer or Tensor or Var args : list of Buffer or Tensor or Var, optional
The argument lists to the function. The argument lists to the function.
target : str target : str, optional
The target of the compilation. The target of the compilation.
target_host : target_host : str, optional
Host compilation target, if target is device. Host compilation target, if target is device.
name : str name : str, optional
The name of result function. The name of result function.
binds : dict, optional binds : dict, optional
Dictionary that maps the binding of symbolic buffer to Tensor. Dictionary that maps the binding of symbolic buffer to Tensor.
By default, a new buffer is created for each tensor in the argument. By default, a new buffer is created for each tensor in the argument.
max_auto_unroll_step: int max_auto_unroll_step: int, optional
Maximum step to perform automatic unrolling Maximum step to perform automatic unrolling
detect_global_barrier: boolean detect_global_barrier: boolean, optional
Whether detect and inser global barrier Whether detect and inser global barrier
Returns Returns
......
...@@ -34,7 +34,7 @@ def array(arr, ctx=cpu(0)): ...@@ -34,7 +34,7 @@ def array(arr, ctx=cpu(0)):
arr : numpy.ndarray arr : numpy.ndarray
The array to be copied from The array to be copied from
ctx : TVMContext ctx : TVMContext, optional
The device context to create the array The device context to create the array
Returns Returns
......
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