class_docstr: RotaryRelativePositionBias module definition.
  
  Args:
      size: Module embedding size.
      max_positions: Maximum number of relative positions.
class_docstr_tok: ["RotaryRelativePositionBias","module","definition",".","Args",":","size",":","Module","embedding","size",".","max_positions",":","Maximum","number","of","relative","positions","."]
docstr: Compute rotary relative position bias.
  
  Args:
      length: Sequence length.
  
  Returns:
      bias: Rotary relative position bias. (L, L)
docstr_tok: ["Compute","rotary","relative","position","bias",".","Args",":","length",":","Sequence","length",".","Returns",":","bias",":","Rotary","relative","position","bias",".","(","L",",","L",")"]
code: def forward(self, length: int) -> torch.Tensor:
      """Compute rotary relative position bias.
  
      Args:
          length: Sequence length.
  
      Returns:
          bias: Rotary relative position bias. (L, L)
  
      """
      alpha = self.rotary(self.alpha.expand(length, self.size))
      beta = self.rotary(self.beta.expand(length, self.size))
  
      bias = torch.einsum("mk, nk -> mn", alpha, beta)
  
      return bias
  
file_path: espnet/espnet2/asr_transducer/decoder/modules/mega/positional_bias.py
imports: import math
  from typing import Tuple
  import torch
label_desc: Use image node_id 5 for calling the RotaryRelativePositionBias obj's underlying member method code with example usage: obj.forward(length) and returns: bias