You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2019/11/20 23:29:53 UTC

[GitHub] [incubator-tvm] wweic commented on a change in pull request #4389: [fix][pass] Save the function when it is used as a call arg

wweic commented on a change in pull request #4389: [fix][pass] Save the function when it is used as a call arg
URL: https://github.com/apache/incubator-tvm/pull/4389#discussion_r348798338
 
 

 ##########
 File path: src/relay/backend/vm/removed_unused_funcs.cc
 ##########
 @@ -76,6 +72,15 @@ struct CallTracer : ExprVisitor {
       }
       visiting_.insert(func);
       VisitExpr(func);
+    } else {
+      VisitExpr(expr);
+    }
+  }
+
+  void VisitExpr_(const CallNode* call_node) final {
+    CheckExpr(call_node->op);
+    for (auto param : call_node->args) {
+      CheckExpr(param);
     }
 
 Review comment:
   Can the bug be fixed by adding the code here? Looks like the bug is we don't continue visit the expression if it's not FunctionNode or GlobalVarNode. 
   ````python
   else {
         VisitExpr(expr);
       }
   ````

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services