class_docstr: Quantized version of `torch.nn.Embedding`. Adds quantization-specific arguments on top of `torch.nn.Embedding`.
  
  Args:
      weight_bit (`int`, *optional*, defaults to `8`):
          Bitwidth for the quantized weight.
      momentum (`float`, *optional*, defaults to `0.95`):
          Momentum for updating the activation quantization range.
      quant_mode (`bool`, *optional*, defaults to `False`):
          Whether or not the layer is quantized.
class_docstr_tok: ["Quantized","version","of","`","torch.nn.Embedding","`",".","Adds","quantization-specific","arguments","on","top","of","`","torch.nn.Embedding","`",".","Args",":","weight_bit","(","`","int","`",",","*","optional","*",",","defaults","to","`","8","`",")",":","Bitwidth","for","the","quantized","weight",".","momentum","(","`","float","`",",","*","optional","*",",","defaults","to","`","0.95","`",")",":","Momentum","for","updating","the","activation","quantization","range",".","quant_mode","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","the","layer","is","quantized","."]
code: def __init__(
      self,
      num_embeddings,
      embedding_dim,
      padding_idx=None,
      max_norm=None,
      norm_type=2.0,
      scale_grad_by_freq=False,
      sparse=False,
      _weight=None,
      weight_bit=8,
      momentum=0.95,
      quant_mode=False,
  ):
      super().__init__()
      self.num_ = num_embeddings
      self.dim = embedding_dim
      self.padding_idx = padding_idx
      self.max_norm = max_norm
      self.norm_type = norm_type
      self.scale_grad_by_freq = scale_grad_by_freq
      self.sparse = sparse
  
      self.weight = nn.Parameter(
          torch.zeros([num_embeddings, embedding_dim])
      )
      self.register_buffer("weight_scaling_factor", torch.zeros(1))
      self.register_buffer(
          "weight_integer", torch.zeros_like(self.weight)
      )
  
      self.weight_bit = weight_bit
      self.momentum = momentum
      self.quant_mode = quant_mode
      self.percentile_mode = False
      self.weight_function = SymmetricQuantFunction.apply
  
imports: import decimal
  import numpy
  import torch
  from torch import nn
  from torch.autograd import Function
  from ...utils import logging
label_desc: Use image node_id 1 to create a new QuantEmbedding object from inherited base classes: nn with example: obj = QuantEmbedding(num_embeddings, embedding_dim, padding_idx, max_norm, norm_type, scale_grad_by_freq, sparse, _weight, weight_bit, momentum, quant_mode)