class_docstr: The abstract class for the compression graph passes.
class_docstr_tok: ["The","abstract","class","for","the","compression","graph","passes","."]
docstr: The utility function is checking the OptimizationConfig is holding correct type of op config.
code: def _check_config_type(self, config: OptimizationConfig):
      """
      The utility function is checking the OptimizationConfig is holding correct type of op config.
      """
  
      def get_supported_types_as_str(supported_type):
          if not isinstance(supported_type, (tuple, list)):
              supported_type = [supported_type]
          return ", ".join(
              [f"{val.__name__}" for val in supported_type]
          )
  
      all_configs = []
      if config.global_config is not None:
          all_configs.append(config.global_config)
      all_configs.extend(list(config.op_type_configs.values()))
      all_configs.extend(list(config.op_name_configs.values()))
  
      for config in all_configs:
          if (
              not isinstance(config, self._SUPPORTED_CONFIG_TYPE)
              and config is not None
          ):
              supported_type_str = get_supported_types_as_str(
                  self._SUPPORTED_CONFIG_TYPE
              )
              raise ValueError(
                  f"{self.__class__.__name__} only accept {supported_type_str} type config. Got {config.__class__.__name__}."
              )
  
imports: from typing import Callable, Optional, Tuple
  import numpy
  from tqdm import tqdm
  from coremltools import _logger
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget
  from coremltools.converters.mil.backend.mil.load import should_use_weight_file
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Operation, Program, types
  from coremltools.converters.mil.mil.block import is_current_opset_version_compatible_with
  from coremltools.converters.mil.mil.ops.defs._utils import pack_elements_into_bits
  from coremltools.converters.mil.mil.ops.defs.iOS16 import constexpr_affine_dequantize, constexpr_lut_to_dense, constexpr_sparse_to_dense
  from coremltools.converters.mil.mil.passes.defs.quantization import AbstractQuantizationPass
  from coremltools.converters.mil.mil.passes.helper import block_context_manager
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
  from coremltools.converters.mil.mil.types.type_mapping import nptype_from_builtin
  from coremltools.models.neural_network.quantization_utils import _get_kmeans_lookup_table_and_weight
  from coremltools.optimize.coreml._config import OpLinearQuantizerConfig, OpMagnitudePrunerConfig, OpPalettizerConfig, OpThresholdPrunerConfig, OptimizationConfig
label_desc: Use image node_id 6 for calling the AbstractCompressionPass obj's underlying member method code with example usage: obj._check_config_type(config) and returns: str