MCPcopy Create free account
hub / github.com/apple/coremltools / _get_function_description

Method _get_function_description

coremltools/models/model.py:915–925  ·  view source on GitHub ↗
(
        self, function_name: str
    )

Source from the content-addressed store, hash-verified

913 return len(self._spec.description.functions) > 0
914
915 def _get_function_description(
916 self, function_name: str
917 ) -> "_proto.Model_pb2.FunctionDescription":
918 f = list(filter(lambda f: f.name == function_name, self._spec.description.functions))
919
920 if len(f) == 0:
921 raise ValueError(f"function_name {function_name} not found in the model.")
922
923 assert len(f) == 1, f"Invalid proto: two functions with the same name {function_name}."
924
925 return f[0]
926
927 def make_state(self) -> MLState:
928 """

Callers 2

__init__Method · 0.95
compare_shapesFunction · 0.80

Calls 2

listFunction · 0.50
lenFunction · 0.50

Tested by 1

compare_shapesFunction · 0.64