Lunderberg commented on code in PR #13396:
URL: https://github.com/apache/tvm/pull/13396#discussion_r1023296204
##########
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:
I was going back and forth on it, and I like the idea of printing
`T.evaluate()` except in the case of CallNode. The more aggressive sugaring
would be to render `tir::Evaluate(0)` as `pass`, which would be even clearer to
read from a casual Python reader.
--
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]