class_docstr: Relative positional encoding module (old version).
  
  Details can be found in https://github.com/espnet/espnet/pull/2816.
  
  See : Appendix B in https://arxiv.org/abs/1901.02860
  
  Args:
      d_model (int): Embedding dimension.
      dropout_rate (float): Dropout rate.
      max_len (int): Maximum input length.
class_docstr_tok: ["Relative","positional","encoding","module","(","old","version",")",".","Details","can","be","found","in","https",":","\/\/github.com\/espnet\/espnet\/pull\/2816",".","See",":","Appendix","B","in","https",":","\/\/arxiv.org\/abs\/1901.02860","Args",":","d_model","(","int",")",":","Embedding","dimension",".","dropout_rate","(","float",")",":","Dropout","rate",".","max_len","(","int",")",":","Maximum","input","length","."]
docstr: Initialize class.
docstr_tok: ["Initialize","class","."]
code: def __init__(self, d_model, dropout_rate, max_len=5000):
      """Initialize class."""
      super().__init__(
          d_model=d_model,
          dropout_rate=dropout_rate,
          max_len=max_len,
          reverse=True,
      )
  
imports: import math
  import torch
label_desc: Use image node_id 1 to create a new LegacyRelPositionalEncoding object from inherited base classes: PositionalEncoding with example: obj = LegacyRelPositionalEncoding(d_model, dropout_rate, max_len)