Test simple expression mutations
()
| 416 | |
| 417 | |
| 418 | def 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 | |
| 435 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected
searching dependent graphs…