junrushao commented on code in PR #13396:
URL: https://github.com/apache/tvm/pull/13396#discussion_r1023258542


##########
python/tvm/script/parser/tir/parser.py:
##########
@@ -411,6 +412,10 @@ def visit_expr_stmt(self: Parser, node: doc.Expr) -> None:
     if isinstance(res, Frame):
         res.add_callback(partial(res.__exit__, None, None, None))
         res.__enter__()
+    elif isinstance(res, PrimExpr):
+        T.evaluate(res)
+    elif isinstance(res, (int, bool)):
+        T.evaluate(tvm.tir.const(res))

Review Comment:
   hey i was wondering if we want to explicitly print `T.evaluate(0)` vs `0`? 
The former one might look a bit clearer from my perspective



##########
tests/python/unittest/test_tvmscript_roundtrip.py:
##########
@@ -3458,6 +3458,15 @@ def func() -> None:
     return func
 
 
+def implicit_evaluate():
+    @T.prim_func
+    def func(A: T.Buffer[1, "int32"]):
+        T.evaluate(T.assume(A[0] == 5))
+        A[0] = 10

Review Comment:
   just curious what's this line for?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to