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

Function test_simple_stmt_expr_visitor

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

Test stmt_expr_visitor with mixed statements and expressions

()

Source from the content-addressed store, hash-verified

291
292
293def test_simple_stmt_expr_visitor():
294 """Test stmt_expr_visitor with mixed statements and expressions"""
295 x = Var("x", dtype="int32")
296 y = Var("y", dtype="int32")
297
298 # Create an evaluate statement with an expression
299 expr = Add(x, y)
300 stmt = Evaluate(expr)
301
302 visitor = SimpleStmtExprVisitor()
303 visitor.visit_stmt(stmt)
304
305 assert visitor.stmt_count == 1 # One Evaluate statement
306 assert visitor.expr_count == 2 # Two variables
307 assert "x" in visitor.var_names
308 assert "y" in visitor.var_names
309
310
311def test_complex_mutator():

Callers

nothing calls this directly

Calls 5

VarClass · 0.90
AddClass · 0.90
EvaluateClass · 0.90
visit_stmtMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…