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 2022/12/16 20:56:20 UTC

[GitHub] [tvm] slyubomirsky commented on a diff in pull request #13630: [BugFix][TVMScript] Parser crash

slyubomirsky commented on code in PR #13630:
URL: https://github.com/apache/tvm/pull/13630#discussion_r1051152722


##########
python/tvm/script/parser/core/parser.py:
##########
@@ -150,7 +150,7 @@ def add(self, var: str, value: Any, allow_shadowing: bool = False):
             The options of whether variable shadowing allwed for this variable.
         """
         # Skip if the key and value are equal to those in the var_table
-        if self.name2value[var] and self.name2value[var][-1] == value:
+        if self.name2value[var] and self.name2value[var][-1] is value:
             return

Review Comment:
   I believe the `is` operator checks reference equality rather than value equality. For integers, it will just check equality, so @lightzhan-intellif is correct. Whether it's preferred style is another question



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org