class_docstr: This class is testing the api reference code in
  https://coremltools.readme.io/v7.0/docs/optimizecoreml-api-overview
code: def test_linear_quantization_config_from_yaml(self):
      import coremltools.optimize.coreml as cto
  
      mlmodel = get_mlmodel()
  
      config_dict = {
          "config_type": "OpLinearQuantizerConfig",
          "global_config": {
              "mode": "linear_symmetric",
              "dtype": "int8",
          },
      }
      yaml_file = _TestConfigurationFromDictFromYaml.get_yaml(
          config_dict
      )
  
      # (original) config = cto.OptimizationConfig.from_yaml("linear_config.yaml")
      config = cto.OptimizationConfig.from_yaml(yaml_file)
      compressed_mlmodel = cto.linear_quantize_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_affine_dequantize") == 6
  
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 2 for calling the TestOptimizeCoremlAPIOverview obj's underlying member method code with example usage: obj.test_linear_quantization_config_from_yaml() without return types