docstr: Get all calibration information in the wrappers.
  
  Returns
  -------
  Dict[str, Dict[str, Dict[str, torch.Tensor | Any]]]
      The calibration config format is {module_name: {target_name: {info_key: val}}}.
      By default, info_key contains ['scale', 'zero_point', 'quant_dtype', 'quant_scheme', 'quant_bits'] and
      ['tracked_max', 'tracked_min'] if it has.
  
      NOTE: The internal key of the calibration config for the target is not stable,
      might be adjusted according to the needs of speedup.
docstr_tok: ["Get","all","calibration","information","in","the","wrappers",".","Returns","--","--","--","-","Dict","[","str",",","Dict","[","str",",","Dict","[","str",",","torch.Tensor","|","Any","]","]","]","The","calibration","config","format","is","{","module_name",":","{","target_name",":","{","info_key",":","val","}","}","}",".","By","default",",","info_key","contains","[","'scale","'",",","'zero_point","'",",","'quant_dtype","'",",","'quant_scheme","'",",","'quant_bits","'","]","and","[","'tracked_max","'",",","'tracked_min","'","]","if","it","has",".","NOTE",":","The","internal","key","of","the","calibration","config","for","the","target","is","not","stable",",","might","be","adjusted","according","to","the","needs","of","speedup","."]
code: def get_calibration_config(
      self,
  ) -> Dict[str, Dict[str, Dict[str, torch.Tensor | Any]]]:
      """
      Get all calibration information in the wrappers.
  
      Returns
      -------
      Dict[str, Dict[str, Dict[str, torch.Tensor | Any]]]
          The calibration config format is {module_name: {target_name: {info_key: val}}}.
          By default, info_key contains ['scale', 'zero_point', 'quant_dtype', 'quant_scheme', 'quant_bits'] and
          ['tracked_max', 'tracked_min'] if it has.
  
          NOTE: The internal key of the calibration config for the target is not stable,
          might be adjusted according to the needs of speedup.
      """
      calibration_config = defaultdict(dict)
      for module_name, wrapper in self._module_wrappers.items():
          for (
              target_name,
              target_space,
          ) in wrapper.quantization_target_spaces.items():
              calibration_config[module_name][target_name] = {
                  "scale": target_space.scale.cpu()
                  if isinstance(target_space.scale, torch.Tensor)
                  else target_space.scale,
                  "zero_point": target_space.zero_point.cpu()
                  if isinstance(target_space.zero_point, torch.Tensor)
                  else target_space.zero_point,
                  "quant_dtype": target_space.quant_dtype
                  if target_space.quant_dtype
                  else "int8",
                  "quant_scheme": target_space.quant_scheme,
                  "quant_bits": target_space.quant_bits,
              }
              if target_space.tracked_max is not None:
                  calibration_config[module_name][target_name][
                      "tracked_max"
                  ] = target_space.tracked_max.cpu()
              elif (
                  target_space.zero_point is not None
                  and target_space.scale is not None
              ):
                  tracked_max = target_space.scale * (
                      target_space.qmax - target_space.zero_point
                  )
                  calibration_config[module_name][target_name][
                      "tracked_max"
                  ] = tracked_max.cpu()
              if target_space.tracked_min is not None:
                  calibration_config[module_name][target_name][
                      "tracked_min"
                  ] = target_space.tracked_min.cpu()
              elif (
                  target_space.zero_point is not None
                  and target_space.scale is not None
              ):
                  tracked_min = target_space.scale * (
                      target_space.qmin - target_space.zero_point
                  )
                  calibration_config[module_name][target_name][
                      "tracked_min"
                  ] = tracked_min.cpu()
  
      return calibration_config
  
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 5 for calling the Quantizer obj's underlying member method code with example usage: obj.get_calibration_config() and returns: calibration_config