class_docstr: RelPositionMultiHeadedAttention definition.
  
  Args:
      num_heads: Number of attention heads.
      embed_size: Embedding size.
      dropout_rate: Dropout rate.
docstr: Attention score computation.
  
  Args:
      query: Transformed query tensor. (B, H, T_1, d_k)
      key: Transformed key tensor. (B, H, T_2, d_k)
      pos_enc: Positional embedding tensor. (B, 2 * T_1 - 1, size)
      left_context: Number of previous frames to use for current chunk
                    attention computation.
  
  Returns:
      : Attention score. (B, H, T_1, T_2)
code: def compute_attention_score(
      self,
      query: torch.Tensor,
      key: torch.Tensor,
      pos_enc: torch.Tensor,
      left_context: int = 0,
  ) -> torch.Tensor:
      """Attention score computation.
  
      Args:
          query: Transformed query tensor. (B, H, T_1, d_k)
          key: Transformed key tensor. (B, H, T_2, d_k)
          pos_enc: Positional embedding tensor. (B, 2 * T_1 - 1, size)
          left_context: Number of previous frames to use for current chunk
                        attention computation.
  
      Returns:
          : Attention score. (B, H, T_1, T_2)
  
      """
      p = self.linear_pos(pos_enc).view(
          pos_enc.size(0), -1, self.num_heads, self.d_k
      )
  
      query = query.transpose(1, 2)
      q_with_bias_u = (query + self.pos_bias_u).transpose(1, 2)
      q_with_bias_v = (query + self.pos_bias_v).transpose(1, 2)
  
      matrix_ac = torch.matmul(q_with_bias_u, key.transpose(-2, -1))
  
      matrix_bd = torch.matmul(q_with_bias_v, p.permute(0, 2, 3, 1))
      matrix_bd = self.rel_shift(matrix_bd, left_context=left_context)
  
      return (matrix_ac + matrix_bd) / math.sqrt(self.d_k)
  
file_path: espnet/espnet2/asr_transducer/encoder/modules/attention.py
imports: import math
  from typing import Optional, Tuple
  import torch
label_desc: Use image node_id 4 for calling the RelPositionMultiHeadedAttention obj's underlying member method code with example usage: obj.compute_attention_score(query, key, pos_enc, left_context) and returns: unknown