class_docstr: Relative positional encoding for sliding window attention or chunked attention.
  See above for relative positional encoding based on Transformer-XL paper
  Args:
      left_chunk_size (int): number of frames to in past chunks
      chunk size (int): number of frames (max frames if using multimode) in current chunk
      d_model (int): embedding dim
      dropout_rate (float): dropout rate
      max_len (int): maximum input length
      xscale (bool): whether to scale the input by sqrt(d_model)
      dropout_rate_emb (float): dropout rate for the positional embeddings
class_docstr_tok: ["Relative","positional","encoding","for","sliding","window","attention","or","chunked","attention",".","See","above","for","relative","positional","encoding","based","on","Transformer-XL","paper","Args",":","left_chunk_size","(","int",")",":","number","of","frames","to","in","past","chunks","chunk","size","(","int",")",":","number","of","frames","(","max","frames","if","using","multimode",")","in","current","chunk","d_model","(","int",")",":","embedding","dim","dropout_rate","(","float",")",":","dropout","rate","max_len","(","int",")",":","maximum","input","length","xscale","(","bool",")",":","whether","to","scale","the","input","by","sqrt","(","d_model",")","dropout_rate_emb","(","float",")",":","dropout","rate","for","the","positional","embeddings"]
code: def __init__(self, att_context_size, **kwargs):
      super(LocalAttRelPositionalEncoding, self).__init__(**kwargs)
      self.left_context = att_context_size[0]
      self.right_context = att_context_size[1]
  
imports: import math
  from functools import lru_cache
  from typing import List, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from nemo.utils import avoid_float16_autocast_context
label_desc: Use image node_id 1 to create a new LocalAttRelPositionalEncoding object from inherited base classes: PositionalEncoding with example: obj = LocalAttRelPositionalEncoding(att_context_size)