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

Function test_subgraph1

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

Source from the content-addressed store, hash-verified

290
291@requires_coreml_runtime
292def test_subgraph1():
293 x = relax.Var("x", relax.TensorStructInfo([10, 10], "float32"))
294 y = relax.Var("y", relax.TensorStructInfo([10, 10], "float32"))
295 bb = relax.BlockBuilder()
296 with bb.function("main", [x, y]):
297 with bb.dataflow():
298 lv0 = bb.emit(relax.op.multiply(x, y))
299 lv1 = bb.emit(relax.op.nn.softmax(lv0))
300 gv = bb.emit_output(lv1)
301 bb.emit_func_output(gv)
302 mod = bb.get()
303 x_data = tvm.runtime.tensor(np.random.rand(10, 10).astype("float32"), dev)
304 y_data = tvm.runtime.tensor(np.random.rand(10, 10).astype("float32"), dev)
305 verify(mod, [x_data, y_data])
306
307
308@requires_coreml_runtime

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…