class_docstr: <a id="LearnedPositionalEmbeddings"></a>
  
  ## Add parameterized positional encodings
  
  This adds learned positional embeddings to patch embeddings.
class_docstr_tok: ["<","a","id=","''","LearnedPositionalEmbeddings","''",">","<","\/a",">","#","#","Add","parameterized","positional","encodings","This","adds","learned","positional","embeddings","to","patch","embeddings","."]
docstr: * `x` is the patch embeddings of shape `[patches, batch_size, d_model]`
docstr_tok: ["*","`","x","`","is","the","patch","embeddings","of","shape","`","[","patches",",","batch_size",",","d_model","]","`"]
code: def forward(self, x: torch.Tensor):
      """
      * `x` is the patch embeddings of shape `[patches, batch_size, d_model]`
      """
      # Get the positional embeddings for the given patches
      pe = self.positional_encodings[: x.shape[0]]
      # Add to patch embeddings and return
      return x + pe
  
imports: import torch
  from torch import nn
  from labml_helpers.module import Module
  from labml_nn.transformers import TransformerLayer
  from labml_nn.utils import clone_module_list
label_desc: Use image node_id 2 for calling the LearnedPositionalEmbeddings obj's underlying member method code with example usage: obj.forward(x) and returns: unknown