class_docstr: Multi-Head Attention layer inheriting SequenceModule.
  
  Comparing default MHA module in ESPnet, this module returns additional dummy state
  and has step function for autoregressive inference.
  
  Args:
      n_head (int): The number of heads.
      n_feat (int): The number of features.
      dropout_rate (float): Dropout rate.
docstr: Construct an MultiHeadedAttention object.
code: def __init__(
      self, n_feat, n_head, dropout=0.0, transposed=False, **kwargs
  ):
      """Construct an MultiHeadedAttention object."""
      super().__init__()
      assert n_feat % n_head == 0
      # We assume d_v always equals d_k
      self.d_k = n_feat // n_head
      self.h = n_head
      self.linear_q = nn.Linear(n_feat, n_feat)
      self.linear_k = nn.Linear(n_feat, n_feat)
      self.linear_v = nn.Linear(n_feat, n_feat)
      self.linear_out = nn.Linear(n_feat, n_feat)
      self.attn = None
      self.dropout = nn.Dropout(p=dropout)
      self.d_output = n_feat
  
file_path: espnet/espnet2/asr/state_spaces/attention.py
imports: import math
  import numpy
  import torch
  from torch import nn
  from espnet2.asr.state_spaces.base import SequenceModule
label_desc: Use image node_id 1 to create a new MultiHeadedAttention object from inherited base classes: SequenceModule with example: obj = MultiHeadedAttention(n_feat, n_head, dropout, transposed)