class_docstr: Dissecting Transformer Length Extrapolation via the Lens of Receptive Field Analysis
  Based on https://arxiv.org/abs/2212.10356
class_docstr_tok: ["Dissecting","Transformer","Length","Extrapolation","via","the","Lens","of","Receptive","Field","Analysis","Based","on","https",":","\/\/arxiv.org\/abs\/2212.10356"]
docstr: Args:
      num_attention_heads: Number of attention heads
      hidden_size: Hidden size per attention head
docstr_tok: ["Args",":","num_attention_heads",":","Number","of","attention","heads","hidden_size",":","Hidden","size","per","attention","head"]
code: def __init__(
      self,
      bidirectional,
      num_attention_heads,
      layer_type,
      hidden_size,
      max_seq_len=512,
  ):
      """
      Args:
          num_attention_heads: Number of attention heads
          hidden_size: Hidden size per attention head
      """
      super().__init__()
      self.bidirectional = bidirectional
      self.layer_type = layer_type
      self.num_attention_heads = num_attention_heads
      self.hidden_size = hidden_size
      self.max_seq_len = max_seq_len
      self.relative_position = build_relative_position(
          max_seq_len, full=True
      )
  
imports: import torch
  from nemo.collections.nlp.modules.common.megatron.position_embedding.alibi_relative_position_embedding import build_relative_position
  from nemo.utils.decorators import experimental
label_desc: Use image node_id 1 to create a new SandwichRelativePositionEmbedding object from inherited base classes: torch.nn with example: obj = SandwichRelativePositionEmbedding(bidirectional, num_attention_heads, layer_type, hidden_size, max_seq_len)