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 2020/01/13 03:27:30 UTC

[GitHub] [incubator-tvm] yzhliu commented on a change in pull request #4684: [Arith] add ShapeVar representing non-neg valued variable in a tensor shape

yzhliu commented on a change in pull request #4684: [Arith] add ShapeVar representing non-neg valued variable in a tensor shape
URL: https://github.com/apache/incubator-tvm/pull/4684#discussion_r365638409
 
 

 ##########
 File path: src/arithmetic/int_set.cc
 ##########
 @@ -405,6 +405,23 @@ class IntervalSetEvaluator :
     }
   }
 
+  IntervalSet VisitExpr_(const ShapeVarNode* op) final {
+    Var var = GetRef<Var>(op);
+    auto it = dom_map_.find(var);
+    if (it != dom_map_.end()) {
+      IntervalSet res = ToIntervalSet((*it).second);
+      if (res->min_value.same_as(var) &&
+          res->max_value.same_as(var)) {
+        return res;
+      }
+      // recursively evaluate mapped result
+      // in case the domain contains variables to be relaxed.
+      return Eval(res);
+    } else {
+      return IntervalSet(0, GetRef<ShapeVar>(op));
 
 Review comment:
   fair. I'll change and verify.

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