code: def test_linear_quantizer_config_global_config_set(config_dict):
      config = LinearQuantizerConfig.from_dict(config_dict)
      if len(config_dict) == 0:
          assert config.global_config == ModuleLinearQuantizerConfig()
      else:
          keys = [
              "global_config",
              "module_type_configs",
              "module_name_configs",
          ]
          for key in keys:
              if key not in config_dict:
                  param_in_config = getattr(config, key)
                  assert (
                      param_in_config is None
                      or len(param_in_config) == 0
                  )
          if "global_config" in config_dict:
              assert (
                  config.global_config.weight_dtype
                  == config_dict["global_config"]["weight_dtype"]
              )
          if "module_name_configs" in config_dict:
              for key in config_dict["module_name_configs"]:
                  assert (
                      config.module_name_configs[key].weight_dtype
                      == config_dict["module_name_configs"][key][
                          "weight_dtype"
                      ]
                  )
          if "module_type_configs" in config_dict:
              for key in config_dict["module_type_configs"]:
                  assert (
                      config.module_type_configs[key].weight_dtype
                      == config_dict["module_type_configs"][key][
                          "weight_dtype"
                      ]
                  )
  
file_path: coremltools/coremltools/test/optimize/torch/quantization/test_quantizer.py
imports: from collections import OrderedDict
  import cattrs
  import pytest
  import torch
  import torch.ao.quantization
  import torch.nn
  import torch.nn.intrinsic
  import torch.nn.intrinsic.qat
  import torch.nn.quantized
  import torch.nn.quantized.modules.utils
  from coremltools.optimize.torch.quantization import LinearQuantizer, LinearQuantizerConfig, ModuleLinearQuantizerConfig
label_desc: Use image node_id 2 for calling a global function with example usage: test_linear_quantizer_config_global_config_set(config_dict) without return types