yongwww commented on code in PR #14189:
URL: https://github.com/apache/tvm/pull/14189#discussion_r1128956042


##########
src/script/ir_builder/ir/ir.cc:
##########
@@ -69,6 +69,49 @@ void DefFunction(const String& func_name, const BaseFunc& 
func) {
   }
 }
 
+GlobalVar AddFunction(const BaseFunc& func, String func_name_hint) {

Review Comment:
   The main difference is 
[FindModuleFrame](https://github.com/apache/tvm/blob/unity/src/script/ir_builder/ir/utils.h#L31-L35)
 used in `DeclFunction` and `DefFunction`, the two guys are required to be 
called immediately under I.ir_module(). AddFunction and UpdateFunction don't 
have this restriction.
   
   Tried to use decl_function in emit_te, ran into error `ValueError: 
'I.DeclFunction' must be called immediately under I.ir_module()`



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