code: def get_quantized_weight_wrapper(
      model,
      pre_quant_weight: nn.Parameter,
      quantize_weight_fn: Callable,
  ) -> nn.Parameter:
      if id(pre_quant_weight) in quantized_weight_registry:
          compat_tensor = quantized_weight_registry[
              id(pre_quant_weight)
          ]
          if is_zero3_enabled:
              register_external_parameter(model, compat_tensor)
  
          return quantized_weight_registry[id(pre_quant_weight)]
      else:
          (
              quantized_weights,
              quant_scale,
              quant_min,
          ) = quantize_weight_fn()
          quantized_weight_registry[
              id(pre_quant_weight)
          ] = concat_to_compat_param(
              quantized_weights, quant_scale, quant_min
          )
          return quantized_weight_registry[id(pre_quant_weight)]
  
file_path: DeepSpeed/deepspeed/inference/quantization/layers.py
imports: import torch
  from torch import nn
  from torch import Tensor
  from torch.nn import functional
  from .utils import Quantizer, DeQuantizer, concat_to_compat_param
  from typing import Tuple, Callable, Dict
  from deepspeed.runtime.zero import register_external_parameter
label_desc: Use image node_id 1 for calling a global function with example usage: get_quantized_weight_wrapper(model, pre_quant_weight, quantize_weight_fn) and returns: quantized_weight_registry, quantized_weight_registry