code: def __init__(self, config, initial_embeddings=None, emb_lookup=None):
      super().__init__()
  
      if emb_lookup is not None:
          self.emb_lookup = emb_lookup
      else:
          self.emb_lookup = nn.Embedding(
              config.vocab_size,
              config.embedding_dim,
              padding_idx=config.padding_idx,
          )
      self.emb_lookup.to(
          dtype=(torch.half if config.fp16 else torch.float)
      )
      self.embeddings = self.emb_lookup.weight
      nn.init.normal_(
          self.embeddings, mean=0, std=config.embedding_dim**-0.5
      )
      nn.init.constant_(self.embeddings[config.padding_idx], 0)
  
      # load initial weights
      if initial_embeddings is not None:
          self.emb_lookup.weight.data.copy_(
              copy_para(initial_embeddings, config.fp16)
          )
  
      if config.trainable_pos:
          if config.need_offset:
              num_embeddings = (
                  config.max_seq_len + config.padding_idx + 1
              )
          else:
              num_embeddings = config.max_seq_len
          self.embed_positions = TrainablePositionalEmbedding(
              num_embeddings,
              config.embedding_dim,
              config.padding_idx,
              config.need_offset,
          )
          nn.init.normal_(
              self.embed_positions.weight,
              mean=0,
              std=config.embedding_dim**-0.5,
          )
          if config.need_offset is not None:
              nn.init.constant_(
                  self.embed_positions.weight[config.padding_idx], 0
              )
      else:
          self.embed_positions = SinusoidalPositionalEmbedding(
              config.embedding_dim,
              config.padding_idx,
              config.max_seq_len,
              config.fp16,
          )
      self.embedding_dim = config.embedding_dim
      self.dropout = Dropout(config.dropout)
      self.emb_quant = TensorQuantizer(emb_quant_config)
      if config.layernorm_embedding:
          self.layernorm_embedding = LayerNorm(config.embedding_dim)
      else:
          self.layernorm_embedding = None
      self.embed_scale = (
          1.0
          if config.no_scale_embedding
          else math.sqrt(config.embedding_dim)
      )
      self.config = config
  
imports: import math
  import uuid
  from typing import Dict, Optional, List
  import torch
  from torch import Tensor, nn
  from torch.nn import Parameter, LayerNorm, Dropout
  from lightseq.training.ops.pytorch import util
  from lightseq.training.ops.pytorch.layer_base import TransformerEmbeddingLayerBase, TransformerEncoderLayerBase, TransformerDecoderLayerBase
  from .quantization import QuantLinear, TensorQuantizer, act_quant_config, weight_quant_config, out_quant_config, emb_quant_config
label_desc: Use image node_id 1 to create a new TransformerEmbeddingLayer object from inherited base classes: TransformerEmbeddingLayerBase with example: obj = TransformerEmbeddingLayer(config, initial_embeddings, emb_lookup)