code: def __init__(
      self,
      dim_model: int,
      seq_len: int,
      vocab_size: int,
      dropout: float = 0.0,
      *args,
      **kwargs,
  ):
      super().__init__()
  
      self.vocab_size = vocab_size
      self.dim_model = dim_model
  
      self.dropout = torch.nn.Dropout(p=dropout)
      self.position_embeddings = nn.Embedding(seq_len, self.dim_model)
      self.word_embeddings = nn.Embedding(
          self.vocab_size, self.dim_model
      )
  
      self.position_ids: Optional[torch.Tensor] = None
  
      self.init_weights()
  
file_path: xformers/xformers/components/positional_embedding/vocab.py
imports: from dataclasses import dataclass
  from typing import Optional
  import torch
  import torch.nn
  from xformers.components.positional_embedding import PositionEmbedding, PositionEmbeddingConfig, register_positional_embedding
label_desc: Use image node_id 1 to create a new VocabEmbedding object from inherited base classes: PositionEmbedding with example: obj = VocabEmbedding(dim_model, seq_len, vocab_size, dropout)