()
| 65 | |
| 66 | |
| 67 | def test_sum_keep_dims(): |
| 68 | @R.function |
| 69 | def foo(x: R.Tensor((1, 2, 3, 4), "float32")) -> R.Tensor((1, 1, 3, 1), "float32"): |
| 70 | gv: R.Tensor((1, 1, 3, 1), "float32") = R.sum(x, axis=[1, 3], keepdims=True) |
| 71 | return gv |
| 72 | |
| 73 | x = relax.Var("x", R.Tensor((1, 2, 3, 4), "float32")) |
| 74 | bb = relax.BlockBuilder() |
| 75 | with bb.function("foo", [x]): |
| 76 | gv = bb.emit(relax.op.sum(x, axis=[1, 3], keepdims=True)) |
| 77 | bb.emit_func_output(gv) |
| 78 | |
| 79 | _check(foo, bb.get()["foo"]) |
| 80 | |
| 81 | |
| 82 | def test_mean(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…