class_docstr: Multi-Head Attention layer of Transformer.
  Args:
      n_head (int): number of heads
      n_feat (int): size of the features
      dropout_rate (float): dropout rate
class_docstr_tok: ["Multi-Head","Attention","layer","of","Transformer",".","Args",":","n_head","(","int",")",":","number","of","heads","n_feat","(","int",")",":","size","of","the","features","dropout_rate","(","float",")",":","dropout","rate"]
docstr: Transforms query, key and value.
  Args:
      query (torch.Tensor): (batch, time1, size)
      key (torch.Tensor): (batch, time2, size)
      value (torch.Tensor): (batch, time2, size)
  returns:
      q (torch.Tensor): (batch, head, time1, size)
      k (torch.Tensor): (batch, head, time2, size)
      v (torch.Tensor): (batch, head, time2, size)
docstr_tok: ["Transforms","query",",","key","and","value",".","Args",":","query","(","torch.Tensor",")",":","(","batch",",","time1",",","size",")","key","(","torch.Tensor",")",":","(","batch",",","time2",",","size",")","value","(","torch.Tensor",")",":","(","batch",",","time2",",","size",")","returns",":","q","(","torch.Tensor",")",":","(","batch",",","head",",","time1",",","size",")","k","(","torch.Tensor",")",":","(","batch",",","head",",","time2",",","size",")","v","(","torch.Tensor",")",":","(","batch",",","head",",","time2",",","size",")"]
code: def forward_qkv(self, query, key, value):
      """Transforms query, key and value.
      Args:
          query (torch.Tensor): (batch, time1, size)
          key (torch.Tensor): (batch, time2, size)
          value (torch.Tensor): (batch, time2, size)
      returns:
          q (torch.Tensor): (batch, head, time1, size)
          k (torch.Tensor): (batch, head, time2, size)
          v (torch.Tensor): (batch, head, time2, size)
      """
      n_batch = query.size(0)
      q = self.linear_q(query).view(n_batch, -1, self.h, self.d_k)
      k = self.linear_k(key).view(n_batch, -1, self.h, self.d_k)
      v = self.linear_v(value).view(n_batch, -1, self.h, self.d_k)
      q = q.transpose(1, 2)
      k = k.transpose(1, 2)
      v = v.transpose(1, 2)
  
      return q, k, v
  
imports: import math
  from functools import lru_cache
  from typing import List, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from nemo.utils import avoid_float16_autocast_context
label_desc: Use image node_id 2 for calling the MultiHeadAttention obj's underlying member method code with example usage: obj.forward_qkv(query, key, value) and returns: q,  k,  v