(
path: str,
compute_units: _ComputeUnit,
function_name: str,
optimization_hints: _Optional[dict] = None,
asset: _Optional[_MLModelAsset] = None,
)
| 25 | |
| 26 | @staticmethod |
| 27 | def _init_check( |
| 28 | path: str, |
| 29 | compute_units: _ComputeUnit, |
| 30 | function_name: str, |
| 31 | optimization_hints: _Optional[dict] = None, |
| 32 | asset: _Optional[_MLModelAsset] = None, |
| 33 | ): |
| 34 | if _macos_version() < (10, 13): |
| 35 | raise Exception("Loading compiled Core ML models is only support on macOS 10.13 or higher.") |
| 36 | if _MLModelProxy is None: |
| 37 | raise Exception("Unable to load any compiled models. This is most likely because" |
| 38 | " coremltools was installed from an egg rather than a wheel.") |
| 39 | |
| 40 | if not isinstance(path, str): |
| 41 | raise TypeError('The "path" parameter must be of type "str".') |
| 42 | |
| 43 | if not asset is None and not isinstance(asset, _MLModelAsset): |
| 44 | raise TypeError('The "asset" parameter must be of type "MLModelAsset".') |
| 45 | |
| 46 | if not isinstance(compute_units, _ComputeUnit): |
| 47 | raise TypeError('The "compute_units" parameter must be of type: "coremltools.ComputeUnit".') |
| 48 | |
| 49 | if not isinstance(function_name, str): |
| 50 | raise TypeError('The "function_name" parameter must be of type "str".') |
| 51 | |
| 52 | _verify_optimization_hint_input(optimization_hints) |
| 53 | |
| 54 | def __init__( |
| 55 | self, |
no test coverage detected