class_docstr: This module learns positional embeddings up to a fixed maximum size.
  Padding ids are ignored by either offsetting based on padding_idx
  or by setting padding_idx to None and ensuring that the appropriate
  position ids are passed to the forward function.
code: def __init__(
      self, num_embeddings: int, embedding_dim: int, padding_idx: int
  ):
      super().__init__(num_embeddings, embedding_dim, padding_idx)
      self.onnx_trace = False
      if self.padding_idx is not None:
          self.max_positions = (
              self.num_embeddings - self.padding_idx - 1
          )
      else:
          self.max_positions = self.num_embeddings
  
file_path: fairseq/fairseq/modules/learned_positional_embedding.py
imports: from typing import Dict, Optional
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import utils
  from torch import Tensor
label_desc: Use image node_id 1 to create a new LearnedPositionalEmbedding object from inherited base classes: nn with example: obj = LearnedPositionalEmbedding(num_embeddings, embedding_dim, padding_idx)