class_docstr: Compute positional encoding
class_docstr_tok: ["Compute","positional","encoding"]
docstr: Forward pass
  
  Args:
  ----
      x: embeddings (batch, max_len, d_model)
  
  Returns
  -------
      positional embeddings (batch, max_len, d_model)
docstr_tok: ["Forward","pass","Args",":","--","--","x",":","embeddings","(","batch",",","max_len",",","d_model",")","Returns","--","--","--","-","positional","embeddings","(","batch",",","max_len",",","d_model",")"]
code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      """Forward pass
  
      Args:
      ----
          x: embeddings (batch, max_len, d_model)
  
      Returns
      -------
          positional embeddings (batch, max_len, d_model)
      """
      x = x + self.pe[:, : x.size(1)]
      return self.dropout(x)
  
imports: import math
  from typing import Any, Callable, Optional, Tuple
  import torch
  from torch import nn
label_desc: Use image node_id 2 for calling the PositionalEncoding obj's underlying member method code with example usage: obj.forward(x) and returns: self