def __init__(
        self,
        model: MLModel,
        compute_units: ComputeUnit = None,
        function_name: Optional[str] = None,
        optimization_hints: Optional[Dict[str, Any]] = None,
        device: Optional[Device] = None,
    ):
        """
        Initializes the MLModelInspector.

        Parameters
        ----------
        model : MLModel
            The MLModel to inspect.

        compute_units : coremltools.ComputeUnit
            The compute units to use. Defaults to the model's compute unit.

        function_name : Optional[str]
            The function name. Defaults to the model's function name.

        optimization_hints : Optional[Dict[str, Any]]
            Keys are the names of the optimization hint, either 'reshapeFrequency' or 'specializationStrategy'.
            Values are enumeration values of type ``coremltools.ReshapeFrequency`` or ``coremltools.SpecializationStrategy``.

        device: Device
           The device on which the model will execute.
        """
        compute_units = compute_units if compute_units is not None else model.compute_unit
        MLModelInspector._init_check(
            model=model,
            compute_units=compute_units,
            function_name=function_name,
            optimization_hints=optimization_hints,
            device=device,
        )

        spec = model.get_spec()
        if spec.WhichOneof("Type") != "mlProgram":
            raise ValueError("MLModelInspector only supports ML program.")

        self.model = model
        self._cached_models = {}
        self._data_type_to_feature_type = {
            proto.MIL_pb2.DataType.FLOAT16: proto.FeatureTypes_pb2.ArrayFeatureType.FLOAT16,
            proto.MIL_pb2.DataType.FLOAT64: proto.FeatureTypes_pb2.ArrayFeatureType.DOUBLE,
            proto.MIL_pb2.DataType.FLOAT32: proto.FeatureTypes_pb2.ArrayFeatureType.FLOAT32,
            proto.MIL_pb2.DataType.INT32: proto.FeatureTypes_pb2.ArrayFeatureType.INT32,
        }
        self._model_spec = spec
        function_name = function_name if function_name is not None else model.function_name
        func_spec = spec.mlProgram.functions.get(
            function_name if function_name is not None else "main", None
        )
        if func_spec is None:
            raise ValueError(f"Missing function for name : {function_name}")

        block_spec = func_spec.block_specializations.get(func_spec.opset, None)
        if block_spec is None:
            raise ValueError(f"Missing block specialization for opset : {func_spec.opset}")

        self._function_name = function_name
        self._optimization_hints = (
            optimization_hints if optimization_hints is not None else model.optimization_hints
        )
        self._output_name_to_op_map = MLModelInspector._create_output_name_to_op_map(
            block_spec.operations
        )
        self.compute_units = compute_units
        self.device = device

        Initializes the MLModelInspector.

        Parameters
        ----------
        model : MLModel
            The MLModel to inspect.

        compute_units : coremltools.ComputeUnit
            The compute units to use. Defaults to the model's compute unit.

        function_name : Optional[str]
            The function name. Defaults to the model's function name.

        optimization_hints : Optional[Dict[str, Any]]
            Keys are the names of the optimization hint, either 'reshapeFrequency' or 'specializationStrategy'.
            Values are enumeration values of type ``coremltools.ReshapeFrequency`` or ``coremltools.SpecializationStrategy``.

        device: Device
           The device on which the model will execute.
        
coremltools/models/ml_program/experimental/debugging_utils.py