class_docstr: RelPositionMultiHeadedAttention definition.
  
  Args:
      num_heads: Number of attention heads.
      embed_size: Embedding size.
      dropout_rate: Dropout rate.
docstr: Transform query, key and value.
  
  Args:
      query: Query tensor. (B, T_1, size)
      key: Key tensor. (B, T_2, size)
      v: Value tensor. (B, T_2, size)
  
  Returns:
      q: Transformed query tensor. (B, H, T_1, d_k)
      k: Transformed key tensor. (B, H, T_2, d_k)
      v: Transformed value tensor. (B, H, T_2, d_k)
code: def forward_qkv(
      self, query: torch.Tensor, key: torch.Tensor, value: torch.Tensor
  ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
      """Transform query, key and value.
  
      Args:
          query: Query tensor. (B, T_1, size)
          key: Key tensor. (B, T_2, size)
          v: Value tensor. (B, T_2, size)
  
      Returns:
          q: Transformed query tensor. (B, H, T_1, d_k)
          k: Transformed key tensor. (B, H, T_2, d_k)
          v: Transformed value tensor. (B, H, T_2, d_k)
  
      """
      n_batch = query.size(0)
  
      q = (
          self.linear_q(query)
          .view(n_batch, -1, self.num_heads, self.d_k)
          .transpose(1, 2)
      )
      k = (
          self.linear_k(key)
          .view(n_batch, -1, self.num_heads, self.d_k)
          .transpose(1, 2)
      )
      v = (
          self.linear_v(value)
          .view(n_batch, -1, self.num_heads, self.d_k)
          .transpose(1, 2)
      )
  
      return q, k, v
  
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 5 for calling the RelPositionMultiHeadedAttention obj's underlying member method code with example usage: obj.forward_qkv(query, key, value) and returns: q,  k,  v