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
5bf1cbda
Commit
5bf1cbda
authored
Oct 05, 2018
by
reminisce
Committed by
Tianqi Chen
Oct 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix saveload json bug (#1831)
parent
51d2e126
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
nnvm/src/pass/saveload_json.cc
+3
-0
nnvm/tests/python/unittest/test_pass_saveload_json.py
+17
-0
No files found.
nnvm/src/pass/saveload_json.cc
View file @
5bf1cbda
...
...
@@ -218,6 +218,9 @@ std::shared_ptr<Symbol> JSONGraph2Symbol(const JSONGraph &jgraph, bool no_parse)
// rebuild attribute parser
if
(
!
no_parse
&&
n
.
node
->
op
()
!=
nullptr
&&
n
.
node
->
op
()
->
attr_parser
!=
nullptr
)
{
n
.
node
->
op
()
->
attr_parser
(
&
(
n
.
node
->
attrs
));
}
else
if
(
!
no_parse
&&
n
.
node
->
is_variable
())
{
n
.
node
->
attrs
.
parsed
=
Symbol
::
CreateVariable
(
n
.
node
->
attrs
.
name
).
outputs
[
0
].
node
->
attrs
.
parsed
;
}
for
(
const
JSONGraph
&
subgraph
:
n
.
subgraphs
)
{
// The "no_parse" option here, is to be compatible with
...
...
nnvm/tests/python/unittest/test_pass_saveload_json.py
0 → 100644
View file @
5bf1cbda
import
nnvm
from
tvm.contrib
import
util
def
test_variable_node_parsed
():
sym
=
nnvm
.
sym
.
Variable
(
'data'
)
tempdir
=
util
.
tempdir
()
json_filename
=
'test_nnvm_symbol.json'
with
open
(
tempdir
.
relpath
(
json_filename
),
'w'
)
as
fo
:
fo
.
write
(
nnvm
.
graph
.
create
(
sym
)
.
json
())
sym_str
=
open
(
tempdir
.
relpath
(
json_filename
),
'r'
)
.
read
()
sym
=
nnvm
.
graph
.
load_json
(
sym_str
)
.
symbol
()
sym
=
nnvm
.
sym
.
relu
(
sym
)
if
__name__
==
'__main__'
:
test_variable_node_parsed
()
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