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
cfc848a7
Unverified
Commit
cfc848a7
authored
Aug 24, 2018
by
Tianqi Chen
Committed by
GitHub
Aug 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[LANG] Improve serializer (#1658)
parent
a1688998
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletions
+9
-1
src/lang/attrs.cc
+2
-0
src/lang/reflection.cc
+5
-0
tests/python/unittest/test_lang_reflection.py
+2
-1
No files found.
src/lang/attrs.cc
View file @
cfc848a7
...
...
@@ -42,4 +42,6 @@ TVM_STATIC_IR_FUNCTOR(IRPrinter, vtable)
TVM_REGISTER_NODE_TYPE
(
DictAttrsNode
);
TVM_REGISTER_NODE_TYPE
(
AttrFieldInfoNode
);
}
// namespace tvm
src/lang/reflection.cc
View file @
cfc848a7
...
...
@@ -236,6 +236,11 @@ class JSONAttrGetter : public AttrVisitor {
node_index_
->
at
(
kv
.
second
.
get
()));
}
}
else
{
// do not need to recover content of global singleton object
// they are registered via the environment
auto
*
f
=
dmlc
::
Registry
<
NodeFactoryReg
>::
Find
(
node
->
type_key
());
if
(
f
!=
nullptr
&&
f
->
fglobal_key
!=
nullptr
)
return
;
// recursively index normal object.
node
->
VisitAttrs
(
this
);
}
}
...
...
tests/python/unittest/test_lang_reflection.py
View file @
cfc848a7
...
...
@@ -58,7 +58,8 @@ def test_make_attrs():
dattr
=
tvm
.
make
.
node
(
"DictAttrs"
,
x
=
1
,
y
=
10
,
name
=
"xyz"
,
padding
=
(
0
,
0
))
assert
dattr
.
x
.
value
==
1
datrr
=
tvm
.
load_json
(
tvm
.
save_json
(
dattr
))
assert
dattr
.
name
.
value
==
"xyz"
def
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