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

Function create_coreml_model

tests/python/contrib/test_coreml_runtime.py:39–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 from coremltools.models.neural_network import NeuralNetworkBuilder
38
39 def create_coreml_model():
40 shape = (2,)
41 alpha = 2
42
43 inputs = [
44 ("input0", coremltools.models.datatypes.Array(*shape)),
45 ("input1", coremltools.models.datatypes.Array(*shape)),
46 ]
47 outputs = [
48 ("output0", coremltools.models.datatypes.Array(*shape)),
49 ("output1", coremltools.models.datatypes.Array(*shape)),
50 ]
51 builder = NeuralNetworkBuilder(inputs, outputs)
52 builder.add_elementwise(
53 name="Add", input_names=["input0", "input1"], output_name="output0", mode="ADD"
54 )
55 builder.add_elementwise(
56 name="Mul", alpha=alpha, input_names=["input0"], output_name="output1", mode="MULTIPLY"
57 )
58 return coremltools.models.MLModel(builder.spec)
59
60 def verify(coreml_model, model_path, dev):
61 coreml_model = create_coreml_model()

Callers 2

verifyFunction · 0.85
test_coreml_runtimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…