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

Function test_const_fold2

tests/python/tirx-base/test_tir_ops.py:54–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52
53
54def test_const_fold2():
55 x = tvm.tirx.Var("x", "int32")
56 tmod = tvm.tirx.truncmod
57 tdiv = tvm.tirx.truncdiv
58 assert (x + 0).same_as(x)
59 assert (0 + x).same_as(x)
60 assert (x - 0).same_as(x)
61 assert tmod(x, 1).value == 0
62 assert (x * 1).same_as(x)
63 assert (1 * x).same_as(x)
64 assert isinstance(tdiv(1, x), tvm.tirx.Div)
65
66
67def test_const_fold3():

Callers

nothing calls this directly

Calls 1

same_asMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…