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

Function test_simple_mutations

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

Test simple expression mutations

()

Source from the content-addressed store, hash-verified

416
417
418def test_simple_mutations():
419 """Test simple expression mutations"""
420 x = Var("x", dtype="int32")
421 y = Var("y", dtype="int32")
422
423 # Test multiple replacements
424 expr = Add(x, y)
425 replacer = VariableReplacer({"x": 1, "y": 2})
426 result = replacer.visit_expr(expr)
427
428 assert isinstance(result, Add)
429 assert isinstance(result.a, IntImm)
430 assert isinstance(result.b, IntImm)
431 assert result.a.value == 1
432 assert result.b.value == 2
433
434
435if __name__ == "__main__":

Callers

nothing calls this directly

Calls 4

VarClass · 0.90
AddClass · 0.90
VariableReplacerClass · 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…