()
| 476 | |
| 477 | |
| 478 | def test_match_cast(): |
| 479 | @R.function |
| 480 | def foo(x: R.Tensor("float32"), y: R.Tensor("float32")): |
| 481 | m = T.int64() |
| 482 | n = T.int64() |
| 483 | x0 = R.match_cast(x, R.Tensor([m], "float32")) |
| 484 | with R.dataflow(): |
| 485 | y0 = R.match_cast(y, R.Tensor([n], "float32")) |
| 486 | gv = y0 |
| 487 | R.output(gv) |
| 488 | return (x0, R.shape([m, n * 2])) |
| 489 | |
| 490 | x = relax.Var("x", R.Tensor("float32")) |
| 491 | y = relax.Var("y", R.Tensor("float32")) |
| 492 | m = tirx.Var("m", dtype="int64") |
| 493 | n = tirx.Var("n", dtype="int64") |
| 494 | y2 = relax.Var("y", R.Tensor([n], "float32")) |
| 495 | bb = relax.BlockBuilder() |
| 496 | with bb.function("foo", (x, y)): |
| 497 | x0 = bb.match_cast(x, R.Tensor([m], "float32")) |
| 498 | with bb.dataflow(): |
| 499 | y0 = bb.match_cast(y, R.Tensor([n], "float32")) |
| 500 | bb.emit_output(y0) |
| 501 | bb.emit_func_output(relax.Tuple([x0, relax.ShapeExpr([m, n * 2])])) |
| 502 | |
| 503 | _check(foo, bb.get()["foo"]) |
| 504 | |
| 505 | |
| 506 | def test_tuple_return(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…