code: def __init__(self, heads, **kwargs):
      super().__init__()
      self.heads = heads
      slopes = torch.Tensor(self._get_slopes(heads))
      slopes = slopes.unsqueeze(1).unsqueeze(1)
      self.register_buffer("slopes", slopes, persistent=False)
      self.register_buffer("bias", None, persistent=False)
  
file_path: OpenNMT-py/onmt/modules/alibi_position_bias.py
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new AlibiPositionalBias object from inherited base classes: nn with example: obj = AlibiPositionalBias(heads)