()
| 71 | |
| 72 | |
| 73 | def 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 | |
| 91 | def test_mod(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…