()
| 50 | |
| 51 | |
| 52 | def test_full_like(): |
| 53 | @R.function |
| 54 | def foo(x: R.Tensor((2, 3), "float16"), v: R.Tensor((), "float32")) -> R.Tensor( |
| 55 | (2, 3), "float16" |
| 56 | ): |
| 57 | gv: R.Tensor((2, 3), "float16") = R.full_like(x, v) |
| 58 | return gv |
| 59 | |
| 60 | x = relax.Var("x", R.Tensor((2, 3), "float16")) |
| 61 | v = relax.Var("y", R.Tensor((), "float32")) |
| 62 | bb = relax.BlockBuilder() |
| 63 | with bb.function("foo", [x, v]): |
| 64 | gv = bb.emit(relax.op.full_like(x, v)) |
| 65 | bb.emit_func_output(gv) |
| 66 | |
| 67 | _check(foo, bb.get()["foo"]) |
| 68 | |
| 69 | |
| 70 | def test_ones(): |