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

Function test_mul_div

tests/python/arith/test_arith_intset.py:73–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71
72
73def test_mul_div():
74 ck = IntSetChecker()
75 x, y = tvm.tirx.Var("x", "int32"), tvm.tirx.Var("y", "int32")
76
77 tdiv = tvm.tirx.truncdiv
78 ck.analyzer.update(y, tvm.arith.ConstIntBound(1, 100), override=True)
79 ck.verify(x * y, {x: tvm.arith.IntervalSet(0, 10)}, (0, 10 * y))
80 ck.verify(x * 2, {x: tvm.arith.IntervalSet(1, 10)}, (2, 20))
81 ck.verify(x * -2, {x: tvm.arith.IntervalSet(1, 10)}, (-20, -2))
82
83 ck.verify(tdiv(x, y), {x: tvm.arith.IntervalSet(0, 10)}, (0, tdiv(10, y)))
84 ck.verify(tdiv(x, 2), {x: tvm.arith.IntervalSet(1, 10)}, (0, 5))
85
86 fld = tvm.tirx.floordiv
87 ck.verify(fld(x, y), {x: tvm.arith.IntervalSet(0, 10)}, (0, fld(10, y)))
88 ck.verify(fld(x, 2), {x: tvm.arith.IntervalSet(-1, 10)}, (-1, 5))
89
90
91def test_mod():

Callers

nothing calls this directly

Calls 3

verifyMethod · 0.95
IntSetCheckerClass · 0.85
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…