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
f52d0713
Commit
f52d0713
authored
Oct 27, 2016
by
tqchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change name matching to SSA Variable and Function matching
parent
062bb853
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
2 deletions
+39
-2
HalideIR
+1
-1
python/tvm/__init__.py
+1
-1
python/tvm/collections.py
+7
-0
python/tvm/function.py
+23
-0
src/c_api/c_api_function.cc
+7
-0
No files found.
HalideIR
@
84a568ce
Subproject commit
9070ac3697931ef5aeb8c373c23b2e8a2fec4627
Subproject commit
84a568ce86ca64ff4e186b78745152061499cbf4
python/tvm/__init__.py
View file @
f52d0713
...
...
@@ -6,4 +6,4 @@ from ._ctypes._api import register_node
from
.
import
expr
from
.
import
stmt
from
.
import
make
from
.
import
domain
from
.
import
collections
python/tvm/
domain
.py
→
python/tvm/
collections
.py
View file @
f52d0713
...
...
@@ -14,3 +14,10 @@ class Array(NodeBase):
def
__repr__
(
self
):
return
'['
+
(
','
.
join
(
str
(
x
)
for
x
in
self
))
+
']'
@register_node
class
Range
(
NodeBase
):
def
__repr__
(
self
):
return
(
'Range(min='
+
str
(
self
.
min
)
+
', extent='
+
str
(
self
.
extent
)
+
')'
)
python/tvm/function.py
View file @
f52d0713
...
...
@@ -41,4 +41,27 @@ def convert(value):
else
:
return
value
def
Range
(
begin
,
**
kwargs
):
"""Create a TVM Range object.
User can either call:
Range(10) to get a range in [0, 10)
or
Range(begin=1, extent=10), to get a range in [0, 11)
Parameters
----------
begin : Expr
The beginning of the expression.
extent : optional, Expr
The extent(i.e. the length) of the range.
"""
if
"extent"
in
kwargs
:
return
_function_internal
.
_Range
(
begin
,
kwargs
[
"extent"
])
else
:
return
_function_internal
.
_Range
(
0
,
begin
);
_init_function_module
(
"tvm"
)
src/c_api/c_api_function.cc
View file @
f52d0713
...
...
@@ -82,4 +82,11 @@ TVM_REGISTER_API(_ArraySize)
static_cast
<
const
ArrayNode
*>
(
sptr
.
get
())
->
data
.
size
());
});
TVM_REGISTER_API
(
_Range
)
.
set_body
([](
const
ArgStack
&
args
,
RetValue
*
ret
)
{
*
ret
=
Range
(
args
.
at
(
0
),
args
.
at
(
1
));
})
.
add_argument
(
"min"
,
"Expr"
,
"beginning of the range."
)
.
add_argument
(
"extent"
,
"Expr"
,
"extent of the range"
);
}
// namespace tvm
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