Mousius commented on a change in pull request #8423:
URL: https://github.com/apache/tvm/pull/8423#discussion_r708560994



##########
File path: src/relay/backend/te_compiler.cc
##########
@@ -383,10 +384,9 @@ class LowerTensorExprMutator : public ExprMutator {
    *  \brief Returns the primitive function associated with \p expr, or
    *  nullptr if none.
    */
-  Function ResolveToPrimitive(Expr expr) {
+  BaseFunc ResolveToPrimitive(Expr expr) {
     if (const GlobalVarNode* gvn = expr.as<GlobalVarNode>()) {
-      BaseFunc base_func = module_->Lookup(GetRef<GlobalVar>(gvn));
-      return ResolveToPrimitive(base_func);
+      return module_->Lookup(GetRef<GlobalVar>(gvn));

Review comment:
       The two callers of this should skip over this by virtue of the:
   ```
   if (prim_func->IsInstance<tir::PrimFuncNode>()) {
     return GetRef<Let>(let);
   }
   ```
   I added to both of them, so it's either undefined in which case it drops 
into not defined or it's a `PrimFunc` which just skips the mutation.
   
   Though there are some failing tests which seem related  - I'll dig into that 
tomorrow.




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