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

        Parameters
        ----------
        model : MLModel
            The model to be validated.

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

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

        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``.

        num_predict_intermediate_outputs : int
            The number of intermediate outputs to retrieve in each ``MLModel`` prediction call. Defaults to 20.

        device: Device
           The device on which the model will execute.
        """

        model_inspector = MLModelInspector(
            model,
            function_name=function_name,
            compute_units=compute_units,
            optimization_hints=optimization_hints,
            device=device,
        )

        self.model = model
        self._outputs = {}
        self._visited = set()
        self._num_predict_intermediate_outputs = num_predict_intermediate_outputs
        self._model_inspector = model_inspector
        self._output_name_to_op_map = self._model_inspector.output_name_to_op_map

        Initializes the MLModelValidator.

        Parameters
        ----------
        model : MLModel
            The model to be validated.

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

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

        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``.

        num_predict_intermediate_outputs : int
            The number of intermediate outputs to retrieve in each ``MLModel`` prediction call. Defaults to 20.

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