class_docstr: This class is testing the api reference code in
  https://coremltools.readme.io/v7.0/docs/optimizecoreml-api-overview
code: def test_customize_ops_to_compress(self):
      import coremltools.optimize.coreml as cto
  
      mlmodel = get_mlmodel()
  
      global_config = cto.OpPalettizerConfig(nbits=6, mode="kmeans")
      linear_config = cto.OpPalettizerConfig(nbits=8, mode="kmeans")
      config = cto.OptimizationConfig(
          global_config=global_config,
          op_type_configs={"linear": linear_config},
          op_name_configs={"conv1": None, "conv3": None},
      )
      compressed_mlmodel = cto.palettize_weights(mlmodel, config)
  
      # Do some basic checks
      assert compressed_mlmodel is not None
      ops = get_op_types_in_program(compressed_mlmodel._mil_program)
      assert ops.count("constexpr_lut_to_dense") == 4
  
imports: import tempfile
  from coremltools.converters.mil.testing_utils import get_op_types_in_program
  from coremltools.test.optimize.coreml.test_passes import TestCompressionPasses
  from coremltools.test.optimize.coreml.test_passes import TestConfigurationFromDictFromYaml
label_desc: Use image node_id 3 for calling the TestOptimizeCoremlAPIOverview obj's underlying member method code with example usage: obj.test_customize_ops_to_compress() without return types