class_docstr: This class implements the Transformer decoder.
  
  Arguments
  ----------
  num_layers: int
      Number of layers.
  nhead: int
      Number of attention heads.
  d_ffn: int
      Hidden size of self-attention Feed Forward layer.
  d_model: int
      Embedding dimension size.
  kdim: int, optional
      Dimension for key.
  vdim: int, optional
      Dimension for value.
  dropout: float, optional
      Dropout rate.
  activation: torch.nn.Module, optional
       Activation function used after non-bottleneck conv layer.
  kernel_size : int, optional
      Kernel size of convolutional layer.
  bias : bool, optional
      Whether  convolution module.
  causal: bool, optional
      Whether the convolutions should be causal or not.
  attention_type: str, optional
      type of attention layer, e.g. regulaMHA for regular MultiHeadAttention.
  
  
  Example
  -------
  >>> src = torch.rand((8, 60, 512))
  >>> tgt = torch.rand((8, 60, 512))
  >>> net = ConformerDecoder(1, 8, 1024, 512, attention_type="regularMHA")
  >>> output, _, _ = net(tgt, src)
  >>> output.shape
  torch.Size([8, 60, 512])
docstr: Arguments
  ----------
  tgt: torch.Tensor
      The sequence to the decoder layer.
  memory: torch.Tensor
      The sequence from the last layer of the encoder.
  tgt_mask: torch.Tensor, optional, optional
      The mask for the tgt sequence.
  memory_mask: torch.Tensor, optional
      The mask for the memory sequence.
  tgt_key_padding_mask : torch.Tensor, optional
      The mask for the tgt keys per batch.
  memory_key_padding_mask : torch.Tensor, optional
      The mask for the memory keys per batch.
  pos_emb_tgt: torch.Tensor, torch.nn.Module, optional
      Module or tensor containing the target sequence positional embeddings for each attention layer.
  pos_embs_src: torch.Tensor, torch.nn.Module, optional
      Module or tensor containing the source sequence positional embeddings for each attention layer.
docstr_tok: ["Arguments","--","--","--","--","--","tgt",":","torch.Tensor","The","sequence","to","the","decoder","layer",".","memory",":","torch.Tensor","The","sequence","from","the","last","layer","of","the","encoder",".","tgt_mask",":","torch.Tensor",",","optional",",","optional","The","mask","for","the","tgt","sequence",".","memory_mask",":","torch.Tensor",",","optional","The","mask","for","the","memory","sequence",".","tgt_key_padding_mask",":","torch.Tensor",",","optional","The","mask","for","the","tgt","keys","per","batch",".","memory_key_padding_mask",":","torch.Tensor",",","optional","The","mask","for","the","memory","keys","per","batch",".","pos_emb_tgt",":","torch.Tensor",",","torch.nn.Module",",","optional","Module","or","tensor","containing","the","target","sequence","positional","embeddings","for","each","attention","layer",".","pos_embs_src",":","torch.Tensor",",","torch.nn.Module",",","optional","Module","or","tensor","containing","the","source","sequence","positional","embeddings","for","each","attention","layer","."]
code: def forward(
      self,
      tgt,
      memory,
      tgt_mask=None,
      memory_mask=None,
      tgt_key_padding_mask=None,
      memory_key_padding_mask=None,
      pos_embs_tgt=None,
      pos_embs_src=None,
  ):
      """
      Arguments
      ----------
      tgt: torch.Tensor
          The sequence to the decoder layer.
      memory: torch.Tensor
          The sequence from the last layer of the encoder.
      tgt_mask: torch.Tensor, optional, optional
          The mask for the tgt sequence.
      memory_mask: torch.Tensor, optional
          The mask for the memory sequence.
      tgt_key_padding_mask : torch.Tensor, optional
          The mask for the tgt keys per batch.
      memory_key_padding_mask : torch.Tensor, optional
          The mask for the memory keys per batch.
      pos_emb_tgt: torch.Tensor, torch.nn.Module, optional
          Module or tensor containing the target sequence positional embeddings for each attention layer.
      pos_embs_src: torch.Tensor, torch.nn.Module, optional
          Module or tensor containing the source sequence positional embeddings for each attention layer.
  
      """
      output = tgt
      self_attns, multihead_attns = [], []
      for dec_layer in self.layers:
          output, self_attn, multihead_attn = dec_layer(
              output,
              memory,
              tgt_mask=tgt_mask,
              memory_mask=memory_mask,
              tgt_key_padding_mask=tgt_key_padding_mask,
              memory_key_padding_mask=memory_key_padding_mask,
              pos_embs_tgt=pos_embs_tgt,
              pos_embs_src=pos_embs_src,
          )
          self_attns.append(self_attn)
          multihead_attns.append(multihead_attn)
      output = self.norm(output)
  
      return output, self_attns, multihead_attns
  
imports: from dataclasses import dataclass
  import torch
  import torch.nn
  import torch.nn.functional
  from typing import Optional, List
  import speechbrain
  import warnings
  from speechbrain.nnet.attention import RelPosMHAXL, MultiheadAttention, PositionalwiseFeedForward
  from speechbrain.utils.dynamic_chunk_training import DynChunkTrainConfig
  from speechbrain.lobes.models.transformer.hypermixing import HyperMixing
  from speechbrain.nnet.normalization import LayerNorm
  from speechbrain.nnet.activations import Swish
label_desc: Use image node_id 2 for calling the ConformerDecoder obj's underlying member method code with example usage: obj.forward(tgt, memory, tgt_mask, memory_mask, tgt_key_padding_mask, memory_key_padding_mask, pos_embs_tgt, pos_embs_src) and returns: output,  self_attns,  multihead_attns