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: * `d_model` is the transformer embeddings size
  * `max_len` is the maximum number of patches
docstr_tok: ["*","`","d_model","`","is","the","transformer","embeddings","size","*","`","max_len","`","is","the","maximum","number","of","patches"]
code: def __init__(self, d_model: int, max_len: int = 5_000):
      """
      * `d_model` is the transformer embeddings size
      * `max_len` is the maximum number of patches
      """
      super().__init__()
      # Positional embeddings for each location
      self.positional_encodings = nn.Parameter(
          torch.zeros(max_len, 1, d_model), requires_grad=True
      )
  
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 1 to create a new LearnedPositionalEmbeddings object from inherited base classes: Module with example: obj = LearnedPositionalEmbeddings(d_model, max_len)