def __init__(
        self,
        model: torch.nn.Module,
        example_inputs: Tuple[torch.tensor],
        num_predict_intermediate_outputs: int = 20,
        target_device: Optional[Device] = None,
        **converter_kwargs,
    ):
        """
        Initialize the TorchScriptMLModelComparator.

        This constructor sets up the comparator by preparing both the PyTorch model and its Core ML counterpart
        for comparison. It traces the PyTorch model, converts it to a Core ML model, and initializes necessary attributes
        for the comparison process.

        Parameters:
        -----------
        model: torch.nn.Module
            The PyTorch model to be compared. This should be a valid PyTorch module that can be traced
            using `torch.jit.trace` and converted to Core ML.

        example_inputs: Tuple[torch.tensor]
            A tuple of example input tensors that will be used to trace the PyTorch model. These inputs
            should be representative of the expected input format and shapes for the model.

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

        target_device: Optional[Device]
            The target device on which to run the Core ML model. If None, the current default device will be used.

        **converter_kwargs : dict
            Additional keyword arguments to be passed to the Core ML converter. These can include
            options like 'minimum_deployment_target', 'compute_units', etc., allowing for fine-tuning
            of the conversion process.
        """
        model.eval()
        self.source_model = model
        self._source_model_inspector = _TorchModuleInspector(
            model=model,
        )

        traced_model = torch.jit.trace(model, example_inputs)
        target_model, module_map_infos = _convert_and_retrieve_jit_module_mapping(
            model=traced_model,
            **converter_kwargs,
        )

        self._source_root_module = next(
            filter(
                lambda module_map: module_map.source.hierarchy == ("",), module_map_infos.values()
            ),
            None,
        )
        self._module_map_infos = module_map_infos
        self.target_model = target_model

        self._target_model_inspector = MLModelInspector(
            model=self.target_model,
            function_name="main",
            device=target_device,
        )

        self._target_output_name_to_op_map = self._target_model_inspector.output_name_to_op_map
        self._target_model_input_names = _get_model_input_names(
            model=self.target_model,
            function_name="main",
        )

        self._source_outputs = {}
        self._target_outputs = {}
        self._num_predict_intermediate_outputs = num_predict_intermediate_outputs

        Initialize the TorchScriptMLModelComparator.

        This constructor sets up the comparator by preparing both the PyTorch model and its Core ML counterpart
        for comparison. It traces the PyTorch model, converts it to a Core ML model, and initializes necessary attributes
        for the comparison process.

        Parameters:
        -----------
        model: torch.nn.Module
            The PyTorch model to be compared. This should be a valid PyTorch module that can be traced
            using `torch.jit.trace` and converted to Core ML.

        example_inputs: Tuple[torch.tensor]
            A tuple of example input tensors that will be used to trace the PyTorch model. These inputs
            should be representative of the expected input format and shapes for the model.

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

        target_device: Optional[Device]
            The target device on which to run the Core ML model. If None, the current default device will be used.

        **converter_kwargs : dict
            Additional keyword arguments to be passed to the Core ML converter. These can include
            options like 'minimum_deployment_target', 'compute_units', etc., allowing for fine-tuning
            of the conversion process.
        
coremltools/models/ml_program/experimental/torch/debugging_utils.py