Skip to content

Commit

Permalink
fix symbol.attr('op_name') (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhreshold authored and tqchen committed Sep 21, 2017
1 parent 65a1a71 commit d00545a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/symbolic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,11 @@ bool Symbol::GetAttr(const std::string& key, std::string* out) const {
*out = node->attrs.name;
return true;
} else if (key == "op_name") {
*out = node->attrs.op->name;
if (node->attrs.op != nullptr) {
*out = node->attrs.op->name;
} else {
*out = "null"; // use null in consistant with json
}
return true;
}
auto it = node->attrs.dict.find(key);
Expand Down

0 comments on commit d00545a

Please sign in to comment.