Skip to content

Commit

Permalink
[RELAY] Fix serialization of OpNode
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed Dec 10, 2018
1 parent 0b64a9f commit ac6b3d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/relay/ir/op.cc
Expand Up @@ -139,8 +139,8 @@ TVM_REGISTER_API("relay.op._Register")
});

NodePtr<Node> CreateOp(const std::string& name) {
auto op = Op::Get(name);
CHECK(!op.defined()) << "Cannot find op \'" << name << '\'';
const Op& op = Op::Get(name);
CHECK(op.defined()) << "Cannot find op \'" << name << '\'';
return op.node_;
}

Expand Down
6 changes: 6 additions & 0 deletions tests/python/relay/test_ir_nodes.py
Expand Up @@ -18,6 +18,11 @@ def test_bad_constructor():
pass


def test_op():
x = relay.op.op.get("add")
check_json_roundtrip(x)


# Span
def test_span():
span = relay.Span(None, 1, 1)
Expand Down Expand Up @@ -210,6 +215,7 @@ def test_tuple_get_item():


if __name__ == "__main__":
test_op()
test_bad_constructor()
test_span()
test_tensor_type()
Expand Down

0 comments on commit ac6b3d4

Please sign in to comment.