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
cf2f5197
Commit
cf2f5197
authored
Jul 31, 2017
by
William Moses
Committed by
Tianqi Chen
Jul 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue relating to serialization of reducer (#282)
parent
cf4e7775
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
include/tvm/ir.h
+1
-0
src/lang/ir.cc
+1
-0
tests/python/unittest/test_lang_reflection.py
+9
-0
No files found.
include/tvm/ir.h
View file @
cf2f5197
...
...
@@ -108,6 +108,7 @@ struct Reduce : public ExprNode<Reduce> {
void
VisitAttrs
(
AttrVisitor
*
v
)
final
{
v
->
Visit
(
"dtype"
,
&
type
);
v
->
Visit
(
"combiner"
,
&
combiner
);
v
->
Visit
(
"source"
,
&
source
);
v
->
Visit
(
"axis"
,
&
axis
);
v
->
Visit
(
"condition"
,
&
condition
);
...
...
src/lang/ir.cc
View file @
cf2f5197
...
...
@@ -97,6 +97,7 @@ Expr Reduce::make(CommReducer combiner, Array<Expr> source,
return
Expr
(
n
);
}
TVM_REGISTER_NODE_TYPE
(
CommReducerNode
);
TVM_REGISTER_NODE_TYPE
(
Reduce
);
TVM_REGISTER_NODE_TYPE
(
AttrStmt
);
...
...
tests/python/unittest/test_lang_reflection.py
View file @
cf2f5197
...
...
@@ -24,7 +24,16 @@ def test_make_node():
assert
AA
.
op
==
A
.
op
assert
AA
.
value_index
==
A
.
value_index
def
test_make_sum
():
A
=
tvm
.
placeholder
((
2
,
10
),
name
=
'A'
)
k
=
tvm
.
reduce_axis
((
0
,
10
),
"k"
)
B
=
tvm
.
compute
((
2
,),
lambda
i
:
tvm
.
sum
(
A
[
i
,
k
],
axis
=
k
),
name
=
"B"
)
json_str
=
tvm
.
save_json
(
B
)
BB
=
tvm
.
load_json
(
json_str
)
assert
B
.
op
.
body
[
0
]
.
combiner
.
handle
.
value
!=
0
assert
BB
.
op
.
body
[
0
]
.
combiner
.
handle
.
value
!=
0
if
__name__
==
"__main__"
:
test_make_node
()
test_const_saveload_json
()
test_make_sum
()
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