MCPcopy Index your code
hub / github.com/apache/tvm / test_add_const

Function test_add_const

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

Source from the content-addressed store, hash-verified

107
108@requires_coreml_runtime
109def test_add_const():
110 x = relax.Var("x", relax.TensorStructInfo([10, 10], "float32"))
111 y = relax.const(np.ones([10, 10]), "float32")
112 bb = relax.BlockBuilder()
113 with bb.function("main", [x]):
114 with bb.dataflow():
115 lv0 = bb.emit(relax.op.add(x, y))
116 gv = bb.emit_output(lv0)
117 bb.emit_func_output(gv)
118 mod = bb.get()
119 x_data = tvm.runtime.tensor(np.random.rand(10, 10).astype("float32"), dev)
120 verify(mod, [x_data])
121
122
123@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
onesMethod · 0.80
verifyFunction · 0.70
addMethod · 0.45
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…