Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
7e032457
Commit
7e032457
authored
Apr 26, 2017
by
Tianqi Chen
Committed by
GitHub
Apr 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PYTHON] Rename the namespace (#105)
parent
e4c74668
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
40 additions
and
41 deletions
+40
-41
python/tvm/__init__.py
+1
-1
python/tvm/_ffi/__init__.py
+0
-0
python/tvm/_ffi/function.py
+10
-10
python/tvm/_ffi/ndarray.py
+1
-1
python/tvm/_ffi/node.py
+2
-2
python/tvm/_ffi/types.py
+0
-0
python/tvm/addon/verilog.py
+2
-2
python/tvm/api.py
+5
-6
python/tvm/arith.py
+2
-2
python/tvm/codegen.py
+1
-1
python/tvm/collections.py
+1
-1
python/tvm/expr.py
+1
-1
python/tvm/intrin.py
+1
-1
python/tvm/ir_builder.py
+1
-1
python/tvm/ir_pass.py
+1
-1
python/tvm/make.py
+1
-1
python/tvm/module.py
+2
-2
python/tvm/ndarray.py
+3
-3
python/tvm/node.py
+1
-1
python/tvm/schedule.py
+2
-2
python/tvm/stmt.py
+1
-1
python/tvm/tensor.py
+1
-1
No files found.
python/tvm/__init__.py
View file @
7e032457
...
...
@@ -18,7 +18,7 @@ from . import ir_builder
from
.
import
ndarray
as
nd
from
.ndarray
import
cpu
,
gpu
,
opencl
,
cl
,
vpi
from
._
ctypes._
function
import
Function
from
._
ffi.
function
import
Function
from
._base
import
TVMError
from
._base
import
__version__
...
...
python/tvm/_
ctypes
/__init__.py
→
python/tvm/_
ffi
/__init__.py
View file @
7e032457
File moved
python/tvm/_
ctypes/_
function.py
→
python/tvm/_
ffi/
function.py
View file @
7e032457
...
...
@@ -10,11 +10,11 @@ from numbers import Number, Integral
from
.._base
import
_LIB
,
check_call
from
.._base
import
c_str
,
py_str
,
string_types
from
.
_
types
import
TVMValue
,
TypeCode
,
TVMType
,
TVMByteArray
from
.
_
types
import
TVMPackedCFunc
,
TVMCFuncFinalizer
from
.
_
types
import
RETURN_SWITCH
,
C_TO_PY_ARG_SWITCH
,
_wrap_arg_func
from
.
_
node
import
NodeBase
,
NodeGeneric
,
convert_to_node
from
.
_
ndarray
import
NDArrayBase
from
.types
import
TVMValue
,
TypeCode
,
TVMType
,
TVMByteArray
from
.types
import
TVMPackedCFunc
,
TVMCFuncFinalizer
from
.types
import
RETURN_SWITCH
,
C_TO_PY_ARG_SWITCH
,
_wrap_arg_func
from
.node
import
NodeBase
,
NodeGeneric
,
convert_to_node
from
.ndarray
import
NDArrayBase
FunctionHandle
=
ctypes
.
c_void_p
ModuleHandle
=
ctypes
.
c_void_p
...
...
@@ -57,7 +57,7 @@ def convert_to_tvm_func(pyfunc):
if
rv
is
not
None
:
if
isinstance
(
rv
,
tuple
):
raise
ValueError
(
"PackedFunction can only support one reurn value"
)
raise
ValueError
(
"PackedFunction can only support one re
t
urn value"
)
temp_args
=
[]
values
,
tcodes
,
_
=
_make_tvm_args
((
rv
,),
temp_args
)
if
not
isinstance
(
ret
,
TVMRetValueHandle
):
...
...
@@ -84,15 +84,15 @@ def _make_tvm_args(args, temp_args):
values
=
(
TVMValue
*
num_args
)()
type_codes
=
(
ctypes
.
c_int
*
num_args
)()
for
i
,
arg
in
enumerate
(
args
):
if
arg
is
None
:
if
isinstance
(
arg
,
NodeBase
):
values
[
i
]
.
v_handle
=
arg
.
handle
type_codes
[
i
]
=
TypeCode
.
NODE_HANDLE
elif
arg
is
None
:
values
[
i
]
.
v_handle
=
None
type_codes
[
i
]
=
TypeCode
.
NULL
elif
isinstance
(
arg
,
NDArrayBase
):
values
[
i
]
.
v_handle
=
ctypes
.
cast
(
arg
.
handle
,
ctypes
.
c_void_p
)
type_codes
[
i
]
=
TypeCode
.
ARRAY_HANDLE
elif
isinstance
(
arg
,
NodeBase
):
values
[
i
]
.
v_handle
=
arg
.
handle
type_codes
[
i
]
=
TypeCode
.
NODE_HANDLE
elif
isinstance
(
arg
,
Integral
):
values
[
i
]
.
v_int64
=
arg
type_codes
[
i
]
=
TypeCode
.
INT
...
...
python/tvm/_
ctypes/_
ndarray.py
→
python/tvm/_
ffi/
ndarray.py
View file @
7e032457
...
...
@@ -8,7 +8,7 @@ import numpy as np
from
.._base
import
_LIB
,
check_call
from
.._base
import
c_array
from
.
_
types
import
TVMType
,
tvm_shape_index_t
from
.types
import
TVMType
,
tvm_shape_index_t
class
TVMContext
(
ctypes
.
Structure
):
"""TVM context strucure."""
...
...
python/tvm/_
ctypes/_
node.py
→
python/tvm/_
ffi/
node.py
View file @
7e032457
...
...
@@ -10,8 +10,8 @@ from numbers import Number, Integral
from
.._base
import
_LIB
,
check_call
from
.._base
import
c_str
,
py_str
,
string_types
from
..
import
_api_internal
from
.
_
types
import
TVMValue
,
TypeCode
from
.
_
types
import
RETURN_SWITCH
,
C_TO_PY_ARG_SWITCH
,
_wrap_arg_func
from
.types
import
TVMValue
,
TypeCode
from
.types
import
RETURN_SWITCH
,
C_TO_PY_ARG_SWITCH
,
_wrap_arg_func
NodeHandle
=
ctypes
.
c_void_p
...
...
python/tvm/_
ctypes/_
types.py
→
python/tvm/_
ffi/
types.py
View file @
7e032457
File moved
python/tvm/addon/verilog.py
View file @
7e032457
...
...
@@ -8,8 +8,8 @@ import ctypes
from
..
import
_api_internal
from
.._base
import
string_types
from
.._
ctypes._
node
import
NodeBase
,
register_node
from
.._
ctypes._
function
import
register_func
from
.._
ffi.
node
import
NodeBase
,
register_node
from
.._
ffi.
function
import
register_func
from
.
import
testing
@register_node
...
...
python/tvm/api.py
View file @
7e032457
...
...
@@ -4,12 +4,11 @@ from __future__ import absolute_import as _abs
from
numbers
import
Integral
as
_Integral
from
._ctypes._types
import
TVMType
from
._ctypes._node
import
register_node
,
NodeBase
from
._ctypes._node
import
convert_to_node
as
_convert_to_node
from
._ctypes._function
import
Function
from
._ctypes._function
import
_init_api
,
register_func
,
get_global_func
from
._ctypes._function
import
convert_to_tvm_func
as
_convert_tvm_func
from
._ffi.node
import
register_node
,
NodeBase
from
._ffi.node
import
convert_to_node
as
_convert_to_node
from
._ffi.function
import
Function
from
._ffi.function
import
_init_api
,
register_func
,
get_global_func
from
._ffi.function
import
convert_to_tvm_func
as
_convert_tvm_func
from
.
import
_api_internal
from
.
import
_base
from
.
import
make
as
_make
...
...
python/tvm/arith.py
View file @
7e032457
"""Arithmetic data structure and utility"""
from
__future__
import
absolute_import
as
_abs
from
._
ctypes._
node
import
NodeBase
,
register_node
from
._
ctypes._
function
import
_init_api
from
._
ffi.
node
import
NodeBase
,
register_node
from
._
ffi.
function
import
_init_api
from
.
import
_api_internal
class
IntSet
(
NodeBase
):
...
...
python/tvm/codegen.py
View file @
7e032457
"""Code generation related functions."""
from
._
ctypes._
function
import
_init_api
from
._
ffi.
function
import
_init_api
def
build_module
(
lowered_func
,
target
):
"""Build lowered_func into Module.
...
...
python/tvm/collections.py
View file @
7e032457
"""Collections contains data structures used in TVM DSL."""
from
__future__
import
absolute_import
as
_abs
from
._
ctypes._
node
import
NodeBase
,
register_node
from
._
ffi.
node
import
NodeBase
,
register_node
from
.
import
_api_internal
@register_node
...
...
python/tvm/expr.py
View file @
7e032457
...
...
@@ -16,7 +16,7 @@ For example, you can use addexp.a to get the left operand of an Add node.
"""
# pylint: disable=missing-docstring
from
__future__
import
absolute_import
as
_abs
from
._
ctypes._
node
import
NodeBase
,
register_node
from
._
ffi.
node
import
NodeBase
,
register_node
from
.
import
make
as
_make
class
ExprOp
(
object
):
...
...
python/tvm/intrin.py
View file @
7e032457
...
...
@@ -3,7 +3,7 @@ from __future__ import absolute_import as _abs
from
.expr
import
Call
as
_Call
from
.
import
make
as
_make
from
._
ctypes._
function
import
register_func
as
_register_func
from
._
ffi.
function
import
register_func
as
_register_func
from
.api
import
convert
def
call_packed
(
*
args
):
...
...
python/tvm/ir_builder.py
View file @
7e032457
...
...
@@ -8,7 +8,7 @@ from . import make as _make
from
.
import
ir_pass
as
_pass
from
.
import
collections
as
_collections
from
._base
import
string_types
from
._
ctypes._
node
import
NodeGeneric
from
._
ffi.
node
import
NodeGeneric
class
WithScope
(
object
):
"""Auxiliary scope with"""
...
...
python/tvm/ir_pass.py
View file @
7e032457
...
...
@@ -6,6 +6,6 @@ The functions are automatically exported from C++ side via PackedFunc.
Each api is a PackedFunc that can be called in a positional argument manner.
You can read "include/tvm/pass.h" for the function signature of these functions.
"""
from
._
ctypes._
function
import
_init_api
from
._
ffi.
function
import
_init_api
_init_api
(
"tvm.ir_pass"
)
python/tvm/make.py
View file @
7e032457
...
...
@@ -6,6 +6,6 @@ The functions are automatically exported from C++ side via PackedFunc.
Each api is a PackedFunc that can be called in a positional argument manner.
You can use make function to build the IR node.
"""
from
._
ctypes._
function
import
_init_api
from
._
ffi.
function
import
_init_api
_init_api
(
"tvm.make"
)
python/tvm/module.py
View file @
7e032457
"""Container of compiled functions of TVM."""
from
__future__
import
absolute_import
as
_abs
from
._
ctypes._
function
import
ModuleBase
,
_init_module_module
from
._
ctypes._
function
import
_init_api
from
._
ffi.
function
import
ModuleBase
,
_init_module_module
from
._
ffi.
function
import
_init_api
class
Module
(
ModuleBase
):
...
...
python/tvm/ndarray.py
View file @
7e032457
...
...
@@ -7,9 +7,9 @@ the correctness of the program.
from
__future__
import
absolute_import
as
_abs
import
numpy
as
_np
from
._
ctypes._
ndarray
import
TVMContext
,
TVMType
,
NDArrayBase
from
._
ctypes._
ndarray
import
cpu
,
gpu
,
opencl
,
vpi
,
empty
,
sync
from
._
ctypes._
ndarray
import
_init_ndarray_module
from
._
ffi.
ndarray
import
TVMContext
,
TVMType
,
NDArrayBase
from
._
ffi.
ndarray
import
cpu
,
gpu
,
opencl
,
vpi
,
empty
,
sync
from
._
ffi.
ndarray
import
_init_ndarray_module
cl
=
opencl
...
...
python/tvm/node.py
View file @
7e032457
...
...
@@ -4,6 +4,6 @@ Normally user do not need to touch this api.
"""
# pylint: disable=unused-import
from
__future__
import
absolute_import
as
_abs
from
._
ctypes._
node
import
NodeBase
,
register_node
from
._
ffi.
node
import
NodeBase
,
register_node
Node
=
NodeBase
python/tvm/schedule.py
View file @
7e032457
"""The computation schedule api of TVM."""
from
__future__
import
absolute_import
as
_abs
from
._
ctypes._
node
import
NodeBase
,
register_node
from
._
ffi.
node
import
NodeBase
,
register_node
from
.
import
_api_internal
from
.
import
tensor
as
_tensor
from
.
import
expr
as
_expr
from
.
import
collections
as
_collections
from
._
ctypes._
function
import
_init_api
from
._
ffi.
function
import
_init_api
@register_node
...
...
python/tvm/stmt.py
View file @
7e032457
...
...
@@ -14,7 +14,7 @@ Each statement node have subfields that can be visited from python side.
assert(st.buffer_var == a)
"""
from
__future__
import
absolute_import
as
_abs
from
._
ctypes._
node
import
NodeBase
,
register_node
from
._
ffi.
node
import
NodeBase
,
register_node
class
Stmt
(
NodeBase
):
pass
...
...
python/tvm/tensor.py
View file @
7e032457
"""Tensor and Operation class for computation declaration."""
# pylint: disable=invalid-name
from
__future__
import
absolute_import
as
_abs
from
._
ctypes._
node
import
NodeBase
,
NodeGeneric
,
register_node
,
convert_to_node
from
._
ffi.
node
import
NodeBase
,
NodeGeneric
,
register_node
,
convert_to_node
from
.
import
_api_internal
from
.
import
make
as
_make
from
.
import
expr
as
_expr
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment