Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions nnvm/src/pass/saveload_json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,6 @@ std::shared_ptr<Symbol> JSONGraph2Symbol(const JSONGraph &jgraph, bool no_parse)
for (uint32_t nid : n.control_deps) {
n.node->control_deps.push_back(jgraph.nodes[nid].node);
}
// 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
// commit cfd3075e85807dcd8f9534c37e053583dee87524
Expand All @@ -230,6 +223,13 @@ std::shared_ptr<Symbol> JSONGraph2Symbol(const JSONGraph &jgraph, bool no_parse)
// incubator-mxnet/src/nnvm/legacy_json_util.cc:UpgradeJSON_Parse
n.node->attrs.subgraphs.push_back(JSONGraph2Symbol(subgraph, false));
}
// 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;
}
}
// consistency check
for (uint32_t nid : jgraph.arg_nodes) {
Expand Down