class_docstr: Initialize the Lightseq Embedding Layer.
  
  Static variable:
      layer_id: The layer-index counter starting from 0 and incrementing by 1 every time a layer object is instantiated,
  Arguments:
      config: An object of LSTransformerEmbeddingLayer config, see get_config
  
      initial_embeddings: Optional: Only used for unit test
class_docstr_tok: ["Initialize","the","Lightseq","Embedding","Layer",".","Static","variable",":","layer_id",":","The","layer-index","counter","starting","from","0","and","incrementing","by","1","every","time","a","layer","object","is","instantiated",",","Arguments",":","config",":","An","object","of","LSTransformerEmbeddingLayer","config",",","see","get_config","initial_embeddings",":","Optional",":","Only","used","for","unit","test"]
code: def forward(self, input, step=0, **kwargs):
      self.config.training = self.training
      self.config.quant_mode = self.quant_mode
      self.config.is_grad_enabled = torch.is_grad_enabled()
  
      if self.config.fp16 and self.para.dtype != torch.half:
          if hasattr(self, "para_16"):
              self.para_16.copy_(self.para.to(torch.half))
          else:
              self.register_buffer(
                  "para_16", self.para.clone().detach().half()
              )
  
      self.__assign_layer_weight_grad()
      input = input.to(torch.int)
      bs, sl = input.size()
      if bs * sl > self.config.max_batch_tokens:
          raise ValueError(
              f"Batch token numbers {bs * sl} exceeds the limit"
              f" {self.config.max_batch_tokens}."
          )
      if sl > self.config.max_seq_len:
          raise ValueError(
              f"Sequence length {sl} exceeds the limit {self.config.max_seq_len}."
          )
      if step >= self.config.max_seq_len:
          raise ValueError(
              f"Target sequence length {sl} exceeds the limit"
              f" {self.config.max_seq_len}."
          )
      x = LSTransformerEmbeddingFunc.apply(
          self.config, input, self.para, step
      )
      return x.to(self.para)
  
imports: import copy
  import torch
  from torch import nn
  from torch.autograd import Function
  from lightseq.training.ops.pytorch import TransformerBuilder
  from lightseq.training.ops.pytorch.layer_base import TransformerEmbeddingLayerBase
  from lightseq.training.ops.pytorch.util import copy_para, state_dict, calc_offset, get_pos_embedding
label_desc: Use image node_id 9 for calling the LSTransformerEmbeddingLayer obj's underlying member method code with example usage: obj.forward(input, step) and returns: x