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
3055d5ed
Commit
3055d5ed
authored
Sep 28, 2017
by
Tianqi Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[JSON] attr->attrs in node attribute, keep backward read compatible (#152)
parent
21e1fc8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
nnvm/src/pass/saveload_json.cc
+3
-1
No files found.
nnvm/src/pass/saveload_json.cc
View file @
3055d5ed
...
...
@@ -79,7 +79,7 @@ struct JSONNode {
// write attributes in order;
std
::
map
<
std
::
string
,
std
::
string
>
dict
(
node
->
attrs
.
dict
.
begin
(),
node
->
attrs
.
dict
.
end
());
writer
->
WriteObjectKeyValue
(
"attr"
,
dict
);
writer
->
WriteObjectKeyValue
(
"attr
s
"
,
dict
);
}
writer
->
WriteObjectKeyValue
(
"inputs"
,
inputs
);
if
(
control_deps
.
size
()
!=
0
)
{
...
...
@@ -96,6 +96,7 @@ struct JSONNode {
helper
.
DeclareField
(
"op"
,
&
op_type_str
);
helper
.
DeclareField
(
"name"
,
&
(
node
->
attrs
.
name
));
helper
.
DeclareField
(
"inputs"
,
&
inputs
);
helper
.
DeclareOptionalField
(
"attrs"
,
&
(
node
->
attrs
.
dict
));
helper
.
DeclareOptionalField
(
"attr"
,
&
(
node
->
attrs
.
dict
));
helper
.
DeclareOptionalField
(
"control_deps"
,
&
control_deps
);
// backward compatible code with mxnet graph.
...
...
@@ -257,6 +258,7 @@ NNVM_REGISTER_PASS(SaveJSON)
DMLC_JSON_ENABLE_ANY
(
std
::
string
,
str
);
DMLC_JSON_ENABLE_ANY
(
std
::
vector
<
int
>
,
list_int
);
DMLC_JSON_ENABLE_ANY
(
std
::
vector
<
std
::
string
>
,
list_str
);
}
// namespace
}
// namespace pass
...
...
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