()
| 35 | |
| 36 | |
| 37 | def test_sum(): |
| 38 | @R.function |
| 39 | def foo(x: R.Tensor((1, 2, 3, 4), "float32")) -> R.Tensor((1, 3), "float32"): |
| 40 | gv: R.Tensor((1, 3), "float32") = R.sum(x, axis=[1, 3]) |
| 41 | return gv |
| 42 | |
| 43 | x = relax.Var("x", R.Tensor((1, 2, 3, 4), "float32")) |
| 44 | bb = relax.BlockBuilder() |
| 45 | with bb.function("foo", [x]): |
| 46 | gv = bb.emit(relax.op.sum(x, axis=[1, 3])) |
| 47 | bb.emit_func_output(gv) |
| 48 | |
| 49 | _check(foo, bb.get()["foo"]) |
| 50 | |
| 51 | |
| 52 | def test_sum_without_specified_axis(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…