tqchen commented on code in PR #14394:
URL: https://github.com/apache/tvm/pull/14394#discussion_r1196872417


##########
include/tvm/relax/expr.h:
##########
@@ -920,10 +920,16 @@ class FunctionNode : public BaseFuncNode {
   Expr body;
   /*! \brief The return type of the function. */
   StructInfo ret_struct_info;
+  /*! \brief Whether the function is annotated as pure or not. */
+  bool is_pure;

Review Comment:
   Thanks for getting these in. One thing that I think would worth distinguish 
is purity annotation (which is more of a UX thing) and `force_pure`. I know it 
is getting into preference part :) So it is debatable.
   
   - is_pure or purity annotation is something that I think is worth to be part 
of function annotation, since this is what we expect most users to annotate and 
is consistent with ret_struct_info
   - force_pure on the other hand, is closer to attributes like `tir.noalias`, 
which affects the compiler internal, and might makes sense to remain as 
attribute `relax.force_pure` for now.
   
   On the syntax side, would be nice if we can enable things like (can serve as 
a followup)
   ```
   @R.function(pure=True, private=True)
   def func(...)
   ```
   
   
   



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