You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2020/07/08 15:35:41 UTC

[incubator-tvm] branch master updated: [TEST][FLAKY] test_arith_solve_linear_inequality.py::test_multi_equal (#6014)

This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/master by this push:
     new 1ae77a8  [TEST][FLAKY] test_arith_solve_linear_inequality.py::test_multi_equal (#6014)
1ae77a8 is described below

commit 1ae77a8c23bec83253722654c76c1901c59368a4
Author: Yizhi Liu <li...@apache.org>
AuthorDate: Wed Jul 8 08:35:28 2020 -0700

    [TEST][FLAKY] test_arith_solve_linear_inequality.py::test_multi_equal (#6014)
---
 tests/python/unittest/test_arith_solve_linear_inequality.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/python/unittest/test_arith_solve_linear_inequality.py b/tests/python/unittest/test_arith_solve_linear_inequality.py
index acdabec..80618dd 100644
--- a/tests/python/unittest/test_arith_solve_linear_inequality.py
+++ b/tests/python/unittest/test_arith_solve_linear_inequality.py
@@ -156,8 +156,16 @@ def test_multi_equal():
     assert solution.ranges[x].extent == 1
     assert len(solution.relations) == 3
     assert ir.structural_equal(solution.relations[0], x == z * y)
-    assert ir.structural_equal(solution.relations[1], z*y - 6 <= 0)
-    assert ir.structural_equal(solution.relations[2], 6 - z*y <= 0)
+
+    assert isinstance(solution.relations[1], tvm.tir.LE)
+    assert solution.relations[1].b == 0
+    assert isinstance(solution.relations[2], tvm.tir.LE)
+    assert solution.relations[2].b == 0
+    # (z*y - 6) <= 0 && (6 - z*y) <= 0
+    ana = tvm.arith.Analyzer()
+    assert ana.simplify(solution.relations[1].a + solution.relations[2].a) == 0
+    assert ir.structural_equal(solution.relations[1].a, (z*y - 6)) or \
+        ir.structural_equal(solution.relations[2].a, (z*y - 6))
 
     solution = arith.solve_linear_inequalities(problem, [x, y, z], deskew_range=True)
     assert solution.src_to_dst[y] == y