lixiaoquan commented on pull request #5780:
URL: https://github.com/apache/incubator-tvm/pull/5780#issuecomment-643039312


   Thanks for fixing this, I found other passes also have similar issue. This 
is VarVisitor used in FreeVars().
   
   
   
   ```
   diff --git a/src/relay/analysis/util.cc b/src/relay/analysis/util.cc
   index 0885a35df..633c3b065 100644
   --- a/src/relay/analysis/util.cc
   +++ b/src/relay/analysis/util.cc
   @@ -214,9 +214,13 @@ class VarVisitor : protected ExprVisitor, protected 
PatternVisitor {
      }
    
      void VisitExpr_(const LetNode* op) final {
   -    MarkBounded(op->var);
   -    VisitExpr(op->value);
   -    VisitExpr(op->body);
   +    Expr let = GetRef<Let>(op);
   +    while (auto let_node = let.as<LetNode>()) {
   +      MarkBounded(let_node->var);
   +      VisitExpr(let_node->value);
   +      let = let_node->body;
   +    }
   +    VisitExpr(let);
      }
    
      void VisitPattern(const Pattern& p) final { 
PatternVisitor::VisitPattern(p); }
   ```
   
   I also run into stack overflow in DeDup() and ConstantFold(), but I'm not 
sure whether they are similar issue.


----------------------------------------------------------------
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:
[email protected]


Reply via email to