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

Function test_check

tests/python/arith/test_arith_deduce_bound.py:124–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122
123
124def test_check():
125 a = tvm.tirx.Var("a", "int32")
126 b = tvm.tirx.Var("b", "int32")
127 c = tvm.tirx.Var("c", "int32")
128 d = tvm.tirx.Var("d", "int32")
129
130 b_s = tvm.arith.IntervalSet(2, 3)
131 c_s = tvm.arith.IntervalSet(5, 7)
132 d_s = tvm.arith.IntervalSet(-3, -1)
133
134 # no compare operator
135 res1 = tvm.arith.deduce_bound(a, a + b, {b: b_s}, {})
136 assert res1.is_nothing()
137
138 # multiple compare operators
139 res2 = tvm.arith.deduce_bound(a, (a + b > 3).astype(c.dtype) > c, {b: b_s, c: c_s}, {})
140 assert res2.is_nothing()
141
142 # multiple target variable
143 res2 = tvm.arith.deduce_bound(a, a * 2 - a > b, {b: b_s}, {})
144 assert res2.is_nothing()
145
146
147def test_deduce_basic():

Callers

nothing calls this directly

Calls 2

is_nothingMethod · 0.80
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…