MCPcopy Create free account
hub / github.com/apache/tvm / test_matmul

Function test_matmul

tests/python/relax/test_codegen_coreml.py:141–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139
140@requires_coreml_runtime
141def 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

Callers

nothing calls this directly

Calls 9

functionMethod · 0.95
dataflowMethod · 0.95
emitMethod · 0.95
emit_outputMethod · 0.95
emit_func_outputMethod · 0.95
getMethod · 0.95
verifyFunction · 0.70
astypeMethod · 0.45
matmulMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…