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

Function test_expand_dims

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

Source from the content-addressed store, hash-verified

199
200@requires_coreml_runtime
201def test_expand_dims():
202 def get_mod(axis):
203 x = relax.Var("x", relax.TensorStructInfo([10, 10], "float32"))
204 bb = relax.BlockBuilder()
205 with bb.function("main", [x]):
206 with bb.dataflow():
207 lv0 = bb.emit(relax.op.expand_dims(x, axis=axis))
208 gv = bb.emit_output(lv0)
209 bb.emit_func_output(gv)
210 return bb.get()
211
212 x_data = tvm.runtime.tensor(np.random.rand(10, 10).astype("float32"), dev)
213 verify(get_mod(axis=0), [x_data])
214 verify(get_mod(axis=1), [x_data])
215
216
217@requires_coreml_runtime

Callers

nothing calls this directly

Calls 3

verifyFunction · 0.70
get_modFunction · 0.70
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…