yzhliu commented on a change in pull request #5367:
URL: https://github.com/apache/incubator-tvm/pull/5367#discussion_r414870644



##########
File path: include/tvm/arith/analyzer.h
##########
@@ -411,8 +412,9 @@ class TVM_DLL Analyzer {
    *
    * \param var The variable.
    * \param expr The expression we bind to.
+   * \param override Whether do we allow override of existing information.

Review comment:
       ```suggestion
      * \param override Whether do we allow override of existing binding 
variables.
   ```
   suggest to be more specific.

##########
File path: src/arith/int_set.cc
##########
@@ -311,6 +311,16 @@ inline IntervalSet Combine<tir::FloorModNode>(Analyzer* 
analyzer,
       LOG(FATAL) << "Modular by zero in CombineInterval Mod";
     }
     if (analyzer->CanProveGreaterEqual(divisor, 0)) {
+      if (b->min_value.as<tir::IntImmNode>()) {

Review comment:
       use `divisor` to keep consistent?

##########
File path: src/te/operation/compute_op.cc
##########
@@ -231,20 +231,18 @@ void ComputeOpNode::PropBoundToInputs(
           // undefined behaviour), so we can intersect the estimated set of 
the argument with the
           // range expected by the tensor. However, intersection may result in 
overly complex
           // expressions, so we perform a more relaxed form of intersection.
-          IntSet arg_intset = EvalSet(call->args[i], dom_map);
+          IntSet arg_intset = analyzer->int_set(call->args[i], 
ConvertDomMap(dom_map));
           const arith::IntervalSetNode* arg_interval = 
arg_intset.as<arith::IntervalSetNode>();
           if (arg_interval) {
             PrimExpr shape_i_min_value = make_zero(t->shape[i].dtype());
             PrimExpr shape_i_max_value = t->shape[i] - 1;
             PrimExpr min_value = arg_interval->min_value;
             PrimExpr max_value = arg_interval->max_value;
             // Prefer the shape bounds only when we can prove they are tighter.
-            if (arith::is_neg_inf(min_value) ||
-                analyzer->CanProve(shape_i_min_value >= min_value)) {
+            if ((arith::is_pos_inf(max_value) && arith::is_neg_inf(min_value)) 
||
+                (analyzer->CanProve(shape_i_min_value >= min_value) &&
+                 analyzer->CanProve(shape_i_max_value <= max_value))) {

Review comment:
       could you elaborate a bit why do we need this change?




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to