code: def __init__(self, head_dim, scale_base=2048):
      super().__init__()
      self.head_dim = head_dim
      self.scale_base = scale_base
      self.register_buffer(
          "scale",
          (torch.arange(0, head_dim, 2) + 0.4 * head_dim)
          / (1.4 * head_dim),
      )
  
file_path: NeMo/nemo/collections/nlp/modules/common/megatron/position_embedding/xpos_position_embedding.py
imports: import torch
  import torch.nn
  from einops import rearrange
  from nemo.utils.decorators import experimental
label_desc: Use image node_id 1 to create a new XPOSPositionEmbedding object from inherited base classes: nn with example: obj = XPOSPositionEmbedding(head_dim, scale_base)