class_docstr: Language model embeddings.
  
  Arguments:
      hidden_size: hidden size
      vocab_size: vocabulary size
      max_sequence_length: maximum size of sequence. This
                           is used for positional embedding
      embedding_dropout_prob: dropout probability for embeddings
      init_method: weight initialization method
      num_tokentypes: size of the token-type embeddings. 0 value
                      will ignore this embedding
      position_embedding_type: position embedding type determines whether we instantiate a learnable position embedding table.
code: def __init__(
      self,
      config: ModelParallelConfig,
      hidden_size,
      vocab_size,
      max_sequence_length,
      embedding_dropout_prob,
      init_method,
      num_tokentypes=0,
      fp32_residual_connection=False,
      position_embedding_type="learned_absolute",
      transpose_batch_sequence=True,
  ):
      super(Embedding, self).__init__(config=config)
  
      self.hidden_size = hidden_size
      self.init_method = init_method
      self.num_tokentypes = num_tokentypes
      self.position_embedding_type = position_embedding_type
      self.transpose_batch_sequence = transpose_batch_sequence
      # Word embeddings (parallel).
      self.word_embeddings = tensor_parallel.VocabParallelEmbedding(
          vocab_size,
          self.hidden_size,
          init_method=self.init_method,
          config=config,
      )
      self._word_embeddings_key = "word_embeddings"
  
      if self.position_embedding_type == "learned_absolute":
          # Position embedding (serial).
          self.position_embeddings = torch.nn.Embedding(
              max_sequence_length,
              self.hidden_size,
              dtype=config.params_dtype,
          )
          self._position_embeddings_key = "position_embeddings"
          # Initialize the position embeddings.
          self.init_method(self.position_embeddings.weight)
  
      if self.position_embedding_type == "learned_parameters":
          # Position embedding (learn parameters directly).
          self.position_embeddings = torch.nn.Parameter(
              torch.empty(max_sequence_length, self.hidden_size)
          )
          self._position_embeddings_key = "position_embeddings"
          # Initialize the position embeddings.
          self.init_method(self.position_embeddings)
  
      # Token type embedding.
      # Add this as an optional field that can be added through
      # method call so we can load a pretrain model without
      # token types and add them as needed.
      self._tokentype_embeddings_key = "tokentype_embeddings"
      if self.num_tokentypes > 0:
          self.tokentype_embeddings = torch.nn.Embedding(
              self.num_tokentypes,
              self.hidden_size,
              dtype=config.params_dtype,
          )
          # Initialize the token-type embeddings.
          self.init_method(self.tokentype_embeddings.weight)
      else:
          self.tokentype_embeddings = None
  
      self.fp32_residual_connection = fp32_residual_connection
      self.sequence_parallel = config.sequence_parallel
  
      # Embeddings dropout
      self.embedding_dropout = torch.nn.Dropout(embedding_dropout_prob)
  
imports: from ast import Mod
  import torch
  from nemo.collections.nlp.modules.common.megatron.adapters.parallel_adapters import AdapterName, PromptEncoderAdapterConfig
  from nemo.collections.nlp.modules.common.megatron.layer_type import LayerType
  from nemo.collections.nlp.modules.common.megatron.module import MegatronModule
  from nemo.collections.nlp.modules.common.megatron.position_embedding import ALiBiRelativePositionEmbedding, KERPLERelativePositionEmbedding, RotaryEmbedding, SandwichRelativePositionEmbedding
  from nemo.collections.nlp.modules.common.megatron.transformer import ParallelTransformer
  from nemo.collections.nlp.modules.common.megatron.utils import ApexGuardDefaults, get_linear_layer, init_method_normal, scaled_init_method_normal
  from nemo.collections.nlp.parts import utils_funcs
  from nemo.core import adapter_mixins
label_desc: Use image node_id 1 to create a new Embedding object from inherited base classes: MegatronModule with example: obj = Embedding(config, hidden_size, vocab_size, max_sequence_length, embedding_dropout_prob, init_method, num_tokentypes, fp32_residual_connection, position_embedding_type, transpose_batch_sequence)