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
class_docstr_tok: ["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"]
code: def __init__(
      self,
      hidden_size,
      vocab_size,
      max_sequence_length,
      embedding_dropout_prob,
      num_tokentypes=0,
      dtype=torch.float,
  ):
      super(VocabParallelEmbedding, self).__init__()
  
      self.hidden_size = hidden_size
      self.num_tokentypes = num_tokentypes
  
      # Word embeddings (parallel).
      self.word_embeddings = VocabParallelEmbedding1D(
          vocab_size, self.hidden_size, dtype=dtype
      )
      self._word_embeddings_key = "word_embeddings"
  
      # Position embedding (serial).
      self.position_embeddings = torch.nn.Embedding(
          max_sequence_length, self.hidden_size, dtype=dtype
      )
      self._position_embeddings_key = "position_embeddings"
      # Initialize the position embeddings.
      # self.init_method(self.position_embeddings.weight)
  
      # 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=dtype
          )
          # Initialize the token-type embeddings.
          # self.init_method(self.tokentype_embeddings.weight)
      else:
          self.tokentype_embeddings = None
  
      # Embeddings dropout
      self.embedding_dropout = torch.nn.Dropout(embedding_dropout_prob)
  
imports: import torch
  import torch.nn.init
  from torch import Tensor
  from torch import nn
  from torch.nn import functional
  from torch.nn.parameter import Parameter
  from colossalai.legacy.context import ParallelMode, seed
  from colossalai.legacy.core import global_context
  from colossalai.legacy.nn.layer.base_layer import ParallelLayer
  from colossalai.legacy.nn.layer.parallel_1d._utils import gather_forward_split_backward, reduce_grad, reduce_input
  from colossalai.legacy.nn.layer.parallel_1d.layers import Linear1D_Row
  from colossalai.legacy.nn.layer.utils import divide
  from colossalai.legacy.registry import LAYERS, LOSSES
  from colossalai.utils import get_current_device
label_desc: Use image node_id 1 to create a new VocabParallelEmbedding object from inherited base classes: torch.nn with example: obj = VocabParallelEmbedding(hidden_size, vocab_size, max_sequence_length, embedding_dropout_prob, num_tokentypes, dtype)