mbs-octoml commented on a change in pull request #10078:
URL: https://github.com/apache/tvm/pull/10078#discussion_r794060009



##########
File path: src/relay/transforms/to_a_normal_form.cc
##########
@@ -223,6 +223,17 @@ class Fill : ExprFunctor<Expr(const Expr&, const Var&)>, 
private transform::Lexi
     bool not_included = include_set_ && include_set_->find(orig) == 
include_set_->end();
     if (!v.defined() && not_included) {
       return annotated_expr;
+    } else if (const LetNode* let = AsIgnoringOnDevice<LetNode>(now)) {
+      // Instead of making a nested binding "let var = (let x = ...; 
bindings...; body)", we push
+      // the inner bindings into the outer scope and bind body to var, giving
+      // "let x = ...; bindings...; let var = body;" as the resulting bindings.
+      Expr e = GetRef<Expr>(let);
+      while (const LetNode* inner_let = AsIgnoringOnDevice<LetNode>(e)) {
+        GetScope(orig)->let_list->Push(inner_let->var, inner_let->value);

Review comment:
       Shoot you're write, I misread the loop sorry!




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