class_docstr: Relative positional encoding module (new implementation).
  
  Args:
      d_model: Embedding dimension.
      dropout_rate: Dropout rate.
      max_len: Maximum input length.
class_docstr_tok: ["Relative","positional","encoding","module","(","new","implementation",")",".","Args",":","d_model",":","Embedding","dimension",".","dropout_rate",":","Dropout","rate",".","max_len",":","Maximum","input","length","."]
docstr: Construct an PositionalEncoding object.
docstr_tok: ["Construct","an","PositionalEncoding","object","."]
code: def __init__(self, max_len, d_model):
      """Construct an PositionalEncoding object."""
      super(RelPositionalEncoding, self).__init__()
      self.d_model = d_model
      self.pe = None
      self.extend_pe(torch.tensor(0.0).expand(1, max_len))
  
file_path: fairseq/fairseq/modules/positional_encoding.py
imports: import torch.nn
  import math
  import torch
label_desc: Use image node_id 1 to create a new RelPositionalEncoding object from inherited base classes: nn with example: obj = RelPositionalEncoding(max_len, d_model)