code: def build_relative_position(max_seq_len, full=True):
      """
      full=True:  shape (max_seq_len, max_seq_len)
      full=False: shape (max_seq_len)
      """
      relative_position = torch.arange(1 - max_seq_len, 1)[None, :].mul(
          -1
      )  # (1, max_seq_len)
  
      if full:
          memory_position = torch.arange(1 - max_seq_len, 1)[
              :, None
          ].mul(-1)
          relative_position = torch.abs(
              memory_position - relative_position
          )  # (max_seq_len, max_seq_len)
  
      if torch.cuda.is_available():
          relative_position = relative_position.to(
              torch.cuda.current_device()
          )
  
      return relative_position
  
file_path: NeMo/nemo/collections/nlp/modules/common/megatron/position_embedding/alibi_relative_position_embedding.py
imports: import math
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: build_relative_position(max_seq_len, full) and returns: relative_position