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

Function test_simple_expr_counter

tests/python/tirx-transform/test_tir_functor.py:213–225  ·  view source on GitHub ↗

Test simple expression counting visitor

()

Source from the content-addressed store, hash-verified

211
212
213def test_simple_expr_counter():
214 """Test simple expression counting visitor"""
215 x = Var("x", dtype="int32")
216 y = Var("y", dtype="int32")
217
218 # Create simple expression: x + y
219 expr = Add(x, y)
220
221 counter = SimpleExprCounter()
222 counter.visit_expr(expr)
223
224 assert counter.var_count == 2 # x and y
225 assert counter.add_count == 1 # one add
226
227
228def test_variable_replacer():

Callers

nothing calls this directly

Calls 4

VarClass · 0.90
AddClass · 0.90
SimpleExprCounterClass · 0.85
visit_exprMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…