You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/04/03 20:44:08 UTC

[GitHub] [incubator-tvm] tqchen commented on a change in pull request #5232: [PYTHON] Make IntImm more like an integer

tqchen commented on a change in pull request #5232: [PYTHON] Make IntImm more like an integer
URL: https://github.com/apache/incubator-tvm/pull/5232#discussion_r403321180
 
 

 ##########
 File path: tests/python/unittest/test_tir_nodes.py
 ##########
 @@ -302,7 +302,21 @@ def test_buffer_load_store():
     assert isinstance(s, tvm.tir.BufferStore)
 
 
+def test_intimm_cond():
+    x = tvm.runtime.convert(1)
+    y = tvm.runtime.convert(1)
+    s = {x}
+    assert y in s
+    assert x == y
 
 Review comment:
   (x == y) becomes another IntImm(with value 1 due to constant folding). Then calling `__bool__` of that value returns the correct value

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services