class_docstr: An embedding bag module attached with FakeQuantize modules for weight,
  used for quantization aware training.
  
  We adopt the same interface as `torch.nn.EmbeddingBag`, please see
  https://pytorch.org/docs/stable/generated/torch.nn.EmbeddingBag.html#torch.nn.EmbeddingBag
  for documentation.
  
  Similar to `torch.nn.EmbeddingBag`, with FakeQuantize modules initialized to
  default.
  
  Attributes:
      weight: fake quant module for weight
class_docstr_tok: ["An","embedding","bag","module","attached","with","FakeQuantize","modules","for","weight",",","used","for","quantization","aware","training",".","We","adopt","the","same","interface","as","`","torch.nn.EmbeddingBag","`",",","please","see","https",":","\/\/pytorch.org\/docs\/stable\/generated\/torch.nn.EmbeddingBag.html","#","torch.nn.EmbeddingBag","for","documentation",".","Similar","to","`","torch.nn.EmbeddingBag","`",",","with","FakeQuantize","modules","initialized","to","default",".","Attributes",":","weight",":","fake","quant","module","for","weight"]
code: def __init__(
      self,
      num_embeddings,
      embedding_dim,
      max_norm=None,
      norm_type=2.0,
      scale_grad_by_freq=False,
      mode="mean",
      sparse=False,
      _weight=None,
      include_last_offset=False,
      padding_idx=None,
      qconfig=None,
      device=None,
      dtype=None,
  ) -> None:
      factory_kwargs = {"device": device, "dtype": dtype}
      super().__init__(
          num_embeddings,
          embedding_dim,
          max_norm,
          norm_type,
          scale_grad_by_freq,
          mode,
          sparse,
          _weight,
          include_last_offset,
          padding_idx,
          **factory_kwargs,
      )
      assert qconfig, "qconfig must be provided for QAT module"
      assert (
          qconfig.weight().qscheme
          == torch.per_channel_affine_float_qparams
      ), (
          "Embedding Bag weights requires a qscheme of torch.per_channel_affine_float_qparams Got "
          + str(qconfig.weight().qscheme)
      )
      self.qconfig = qconfig
      self.weight_fake_quant = qconfig.weight(
          factory_kwargs=factory_kwargs
      )
  
file_path: pytorch/torch/ao/nn/qat/modules/embedding_ops.py
imports: import torch
  from torch import Tensor
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new EmbeddingBag object from inherited base classes: nn with example: obj = EmbeddingBag(num_embeddings, embedding_dim, max_norm, norm_type, scale_grad_by_freq, mode, sparse, _weight, include_last_offset, padding_idx, qconfig, device, dtype)