tqchen 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_r365612202
##########
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:
Shouldn't it be IntervalSet::SinglePoint(var) as in Var? This is a bit
overly relaxed
----------------------------------------------------------------
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]
With regards,
Apache Git Services