()
| 139 | |
| 140 | @requires_coreml_runtime |
| 141 | def test_matmul(): |
| 142 | x = relax.Var("x", relax.TensorStructInfo([8, 10], "float32")) |
| 143 | y = relax.Constant(tvm.runtime.tensor(np.random.rand(10, 8).astype("float32"), dev)) |
| 144 | bb = relax.BlockBuilder() |
| 145 | with bb.function("main", [x]): |
| 146 | with bb.dataflow(): |
| 147 | lv0 = bb.emit(relax.op.matmul(x, y)) |
| 148 | gv = bb.emit_output(lv0) |
| 149 | bb.emit_func_output(gv) |
| 150 | mod = bb.get() |
| 151 | |
| 152 | x_data = tvm.runtime.tensor(np.random.rand(8, 10).astype("float32"), dev) |
| 153 | verify(mod, [x_data]) |
| 154 | |
| 155 | x = relax.Var("x", relax.TensorStructInfo([8, 10], "float32")) |
| 156 | y = relax.Var("y", relax.TensorStructInfo([10, 8], "float32")) |
| 157 | bb = relax.BlockBuilder() |
| 158 | with bb.function("main", [x, y]): |
| 159 | with bb.dataflow(): |
| 160 | lv0 = bb.emit(relax.op.matmul(x, y)) |
| 161 | gv = bb.emit_output(lv0) |
| 162 | bb.emit_func_output(gv) |
| 163 | mod = bb.get() |
| 164 | |
| 165 | x_data = tvm.runtime.tensor(np.random.rand(8, 10).astype("float32"), dev) |
| 166 | y_data = tvm.runtime.tensor(np.random.rand(10, 8).astype("float32"), dev) |
| 167 | verify(mod, [x_data, y_data]) |
| 168 | |
| 169 | |
| 170 | @requires_coreml_runtime |
nothing calls this directly
no test coverage detected
searching dependent graphs…