MCPcopy Create free account
hub / github.com/apache/tvm / test_no_solution

Function test_no_solution

tests/python/arith/test_arith_solve_linear_inequality.py:186–202  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184
185
186def test_no_solution():
187 x = tvm.tirx.Var("x0", "int32")
188 vranges = {x: tvm.ir.Range.from_min_extent(-20, 41)}
189 problem = [-x - 4 <= -5 * x + 2, x * 4 + 5 <= x * 5]
190
191 solution = arith.solve_linear_inequalities(problem, [x], vranges, deskew_range=True)
192 assert list(solution.dst.variables) == []
193 [rel] = solution.dst.relations
194 ir.assert_structural_equal(rel, tirx.const(False))
195 assert len(solution.src_to_dst) == 0
196 assert len(solution.dst_to_src) == 0
197
198 solution = arith.solve_linear_inequalities(problem, [x], vranges)
199 assert len(solution.variables) == 0
200 assert len(solution.ranges) == 0
201 [rel] = solution.relations
202 assert not rel
203
204
205def test_unbound_var_range():

Callers

nothing calls this directly

Calls 1

from_min_extentMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…