class_docstr: <a id="EmbeddingsWithPositionalEncoding"></a>
  
  ## Embed tokens and add [fixed positional encoding](positional_encoding.html)
code: def __init__(self, d_model: int, n_vocab: int, max_len: int = 5000):
      super().__init__()
      self.linear = nn.Embedding(n_vocab, d_model)
      self.d_model = d_model
      self.register_buffer(
          "positional_encodings",
          get_positional_encoding(d_model, max_len),
      )
  
imports: import math
  import torch
  import torch.nn
  from labml_nn.utils import clone_module_list
  from .feed_forward import FeedForward
  from .mha import MultiHeadAttention
  from .positional_encoding import get_positional_encoding
label_desc: Use image node_id 1 to create a new EmbeddingsWithPositionalEncoding object from inherited base classes: nn with example: obj = EmbeddingsWithPositionalEncoding(d_model, n_vocab, max_len)