()
| 451 | |
| 452 | |
| 453 | def test_shadowing(): |
| 454 | @R.function |
| 455 | def foo(x: R.Tensor((4, 4), "float32")): |
| 456 | y = R.add(x, x) |
| 457 | z = R.multiply(x, y) |
| 458 | y = R.add(x, y) |
| 459 | y = z |
| 460 | y = R.multiply(y, x) |
| 461 | z = y |
| 462 | return z |
| 463 | |
| 464 | x = relax.Var("x", R.Tensor((4, 4), "float32")) |
| 465 | bb = relax.BlockBuilder() |
| 466 | with bb.function("foo", (x,)): |
| 467 | y = bb.emit(relax.op.add(x, x)) |
| 468 | z = bb.emit(relax.op.multiply(x, y)) |
| 469 | y = bb.emit(relax.op.add(x, y)) |
| 470 | y = bb.emit(z) |
| 471 | y = bb.emit(relax.op.multiply(y, x)) |
| 472 | z = bb.emit(y) |
| 473 | bb.emit_func_output(z) |
| 474 | |
| 475 | _check(foo, bb.get()["foo"]) |
| 476 | |
| 477 | |
| 478 | def test_match_cast(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…