code: def update_calibration_config(
      self,
      calibration_config: Dict[
          str, Dict[str, Dict[str, torch.Tensor | Any]]
      ],
  ):
      for module_name, target_configs in calibration_config.items():
          for target_name, config in target_configs.items():
              assert (
                  module_name in self._module_wrappers
                  and target_name
                  in self._module_wrappers[
                      module_name
                  ].quantization_target_spaces
              )
              wrapper = self._module_wrappers[module_name]
              target_space = wrapper.quantization_target_spaces[
                  target_name
              ]
              # NOTE: try to auto get the device of the current module
              try:
                  device = next(wrapper.parameters()).device
              except StopIteration:
                  try:
                      device = next(wrapper.buffers()).device
                  except StopIteration:
                      if target_space.scale is not None:
                          device = target_space.scale.device
                      else:
                          # NOTE: this will have risk in model parallel
                          device = next(
                              self.bound_model.parameters()
                          ).device
              config = tree_map(
                  lambda t: t.to(device)
                  if isinstance(t, torch.Tensor)
                  else t,
                  config,
              )
              target_space.scale = config["scale"]
              target_space.zero_point = config["zero_point"]
              assert target_space.quant_bits == config["quant_bits"]
              assert target_space.quant_dtype == config["quant_dtype"]
              assert target_space.quant_scheme == config["quant_scheme"]
  
imports: from __future__ import annotations
  from collections import defaultdict
  from copy import deepcopy
  import logging
  from typing import Any, Dict, List, Literal, Callable
  import torch
  from torch.utils._pytree import tree_map
  from .config import trans_legacy_config_list, default_config_schema
  from .target_space import TargetSpace, TargetType, DistillationTargetSpace, PruningTargetSpace, QuantizationTargetSpace
  from .wrapper import ModuleWrapper, register_wrappers
  from ..utils import Evaluator, Scaling, _EVALUATOR_DOCSTRING
label_desc: Use image node_id 6 for calling the Quantizer obj's underlying member method code with example usage: obj.update_calibration_config(calibration_config) without return types