code: def __init__(
      self, config: Dict, pre_quant_layer: nn.Embedding
  ) -> None:
      super(QuantizedEmbedding, self).__init__(
          num_embeddings=pre_quant_layer.num_embeddings,
          embedding_dim=pre_quant_layer.embedding_dim,
          padding_idx=pre_quant_layer.padding_idx,
          max_norm=pre_quant_layer.max_norm,
          norm_type=pre_quant_layer.norm_type,
          scale_grad_by_freq=pre_quant_layer.scale_grad_by_freq,
          sparse=pre_quant_layer.sparse,
          _weight=pre_quant_layer.weight,
          device=pre_quant_layer.weight.device,
          dtype=pre_quant_layer.weight.dtype,
      )
  
      assert pre_quant_layer.max_norm is None, "Not supported"
      assert pre_quant_layer.norm_type == 2, "Not supported"
      assert (
          pre_quant_layer.scale_grad_by_freq == False
      ), "Not supported"
      assert pre_quant_layer.sparse == False, "Not supported"
  
      self.config = config
      quantizer = Quantizer(config=config)
  
      self.weight = get_quantized_weight_wrapper(
          self,
          pre_quant_layer.weight,
          get_quantize_weight_fn(quantizer, pre_quant_layer.weight),
      )
  
      self.weight.dequantizer = DeQuantizer(
          config, pre_quant_layer.weight.dtype
      )
  
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 to create a new QuantizedEmbedding object from inherited base classes: nn with example: obj = QuantizedEmbedding(config, pre_quant_layer)