()
| 45 | |
| 46 | |
| 47 | def test_simple_func(): |
| 48 | @R.function |
| 49 | def foo(x: R.Tensor((128, 128), "float32")) -> R.Tensor((128, 128), "float32"): |
| 50 | R.func_attr({"Primitive": True}) |
| 51 | gv0 = R.call_dps_packed("extern_func", x, R.Tensor((128, 128), dtype="float32")) |
| 52 | gv1 = R.call_dps_packed("extern_dps_func", gv0, R.Tensor((128, 128), dtype="float32")) |
| 53 | return gv1 |
| 54 | |
| 55 | x = relax.Var("x", R.Tensor((128, 128), "float32")) |
| 56 | bb = relax.BlockBuilder() |
| 57 | with bb.function("foo", (x,), attrs={"Primitive": True}): |
| 58 | y = bb.emit(relax.call_dps_packed("extern_func", x, R.Tensor((128, 128), dtype="float32"))) |
| 59 | out = bb.emit( |
| 60 | relax.call_dps_packed("extern_dps_func", y, R.Tensor((128, 128), dtype="float32")) |
| 61 | ) |
| 62 | bb.emit_func_output(out) |
| 63 | |
| 64 | _check(foo, bb.get()["foo"]) |
| 65 | |
| 66 | |
| 67 | def test_error_report(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…