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

Function create

python/tvm/contrib/coreml_runtime.py:24–50  ·  view source on GitHub ↗

Create a runtime executor module given a coreml model and context. Parameters ---------- symbol : str The symbol that represents the Core ML model. compiled_model_path : str The path of the compiled model to be deployed. device : Device The device to depl

(symbol, compiled_model_path, device)

Source from the content-addressed store, hash-verified

22
23
24def create(symbol, compiled_model_path, device):
25 """Create a runtime executor module given a coreml model and context.
26
27 Parameters
28 ----------
29 symbol : str
30 The symbol that represents the Core ML model.
31 compiled_model_path : str
32 The path of the compiled model to be deployed.
33 device : Device
34 The device to deploy the module. It can be local or remote when there
35 is only one Device.
36 Returns
37 -------
38 coreml_runtime : CoreMLModule
39 Runtime coreml module that can be used to execute the coreml model.
40 """
41 device_type = device.dlpack_device_type()
42 runtime_func = "tvm.coreml_runtime.create"
43
44 if device_type >= rpc_base.RPC_SESS_MASK:
45 fcreate = device._rpc_sess.get_function(runtime_func)
46 else:
47 fcreate = tvm_ffi.get_global_func(runtime_func)
48 assert fcreate, "Cannot find `tvm.coreml_runtime.create` function."
49
50 return CoreMLModule(fcreate(symbol, compiled_model_path))
51
52
53class CoreMLModule:

Callers

nothing calls this directly

Calls 3

CoreMLModuleClass · 0.85
get_global_funcMethod · 0.80
get_functionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…