class_docstr: Relative positional encoding.
  
  Args:
      size: Module size.
      max_len: Maximum input length.
      dropout_rate: Dropout rate.
docstr: Construct a RelativePositionalEncoding object.
docstr_tok: ["Construct","a","RelativePositionalEncoding","object","."]
code: def __init__(
      self, size: int, dropout_rate: float = 0.0, max_len: int = 5000
  ) -> None:
      """Construct a RelativePositionalEncoding object."""
      super().__init__()
  
      self.size = size
  
      self.pe = None
      self.dropout = torch.nn.Dropout(p=dropout_rate)
  
      self.extend_pe(torch.tensor(0.0).expand(1, max_len))
      self._register_load_state_dict_pre_hook(_pre_hook)
  
imports: import math
  import torch
  from espnet.nets.pytorch_backend.transformer.embedding import _pre_hook
label_desc: Use image node_id 1 to create a new RelPositionalEncoding object from inherited base classes: torch.nn with example: obj = RelPositionalEncoding(size, dropout_rate, max_len)