junrushao opened a new pull request, #14207:
URL: https://github.com/apache/tvm/pull/14207

   As the legacy behavior of previous generation of TVMScript printer, LetStmt 
and Let expression in TIR are printed in the same syntax, i.e. `T.let`. This 
could be confusing and misleading at times.
   
   This PR introduces a new printer behavior in a backward compatible way. 
While ensuring all legacy `T.let` can be parsed properly, we introduce 
different syntax for each of them.
   
   For LetStmt in TIR without concise scoping, the new syntax is:
   
   ```python
   with T.LetStmt(value) as var:
     ...
   ```
   
   which was:
   
   ```python
   var = T.int32()
   with T.let(var, value):
     ...
   ```
   
   For let expression in TIR PrimExpr, the new syntax becomes:
   
   ```python
   x = T.int32()
   T.Let(x + 1, where={x : 1})
   ```
   
   which was:
   
   ```python
   x = T.int32()
   T.let(x, 1, x + 1)
   ```


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