kparzysz-quic commented on PR #15260:
URL: https://github.com/apache/tvm/pull/15260#issuecomment-1633313955

   @Lunderberg, @junrushao 
   I'm starting to work on making this more general and extending it to Relax.  
Relax code has a lot of assignments, the targets of which would disappear from 
the frame in the current implementation of `expand_macro`.  My first thought 
was to do something like
   ```
   @R.macro(outputs=["var2, "var3"]):
   def something():
      var1 = ...
      var2 = ...
      var3 = ...
   
   @R.function
   def something_else(...)
      something()
      ... = var3
   ```
   Admittedly, `var3 = something()` looks a lot prettier, but it's sort of 
breaks the idea behind a macro: the macro would have to "return" a value, which 
implies a lot more complications in parsing or expanding it.
   
   I'm wondering if you have any better ideas.


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