tqchen commented on a change in pull request #4357: [Relay tests] Temporary
Attr Update for Order-Independent Testing
URL: https://github.com/apache/incubator-tvm/pull/4357#discussion_r347649770
##########
File path: tests/python/relay/test_ir_op.py
##########
@@ -27,6 +27,32 @@ def test(x):
assert log_op.get_attr("ftest") is None
assert relay.op.get("exp").get_attr("ftest")(1) == 2
+def test_op_reset_attr():
+ """ Tests reset_attr functionality. """
+ def add1(x):
+ return x + 1
+
+ def add2(x):
+ return x + 2
+
+ # Register fadd1 and fadd2 attributes.
+ relay.op.register("exp", "fadd1", add1)
+ relay.op.register("log", "fadd1", add1)
+ relay.op.register("log", "fadd2", add2)
+
+ # Reset log fadd1 attr.
+ log_op = relay.op.get("log")
+ log_op.reset_attr("fadd1")
Review comment:
Let us also test TempOpAttr
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services