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



##########
File path: python/tvm/testing.py
##########
@@ -188,5 +189,96 @@ def assert_prim_expr_equal(lhs, rhs):
         raise ValueError("{} and {} are not equal".format(lhs, rhs))
 
 
+def check_bool_expr_is_true(bool_expr, vranges, cond=None):
+    """ Check that bool_expr holds given the condition cond
+    for every value of free variables from vranges.
+
+    Parameters
+    ----------
+    bool_expr : tvm.ir.expr.PrimExpr
+        Boolean expression to check
+    vranges: Dict[tvm.tir.expr.Var, tvm.ir.Range]
+        Free variables and their ranges
+    cond: tvm.ir.expr.PrimExpr
+        extra conditions needs to be satisfied.
+    """
+    if cond is not None:
+        bool_expr = tvm.te.any(tvm.tir.Not(cond), bool_expr)

Review comment:
       for example, `2x > 4y` solves to `x > 2y` given x \in (0, 10), y \in (0, 
10)
   It essentially creates iterations 
   ```python
   for x in range(10):
     for y in range(10):
       assert !(2x > 4y) || (x > 2y)
   ```
   I'll add the above to the comments




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