class_docstr: This class implements the Transformer decoder.
  Arguments
  ----------
  nhead : int
      Number of attention heads.
  d_ffn : int
      Hidden size of self-attention Feed Forward layer.
  d_model : int
      Dimension of the model.
  kdim : int, optional
      Dimension for key (Optional).
  vdim : int, optional
      Dimension for value (Optional).
  dropout : float, optional
      Dropout for the decoder (Optional).
  Example
  -------
  >>> src = torch.rand((8, 60, 512))
  >>> tgt = torch.rand((8, 60, 512))
  >>> net = TransformerDecoder(1, 8, 1024, d_model=512)
  >>> output, _, _ = net(src, tgt)
  >>> output.shape
  torch.Size([8, 60, 512])
code: def __init__(
      self,
      num_layers,
      nhead,
      d_ffn,
      d_model,
      kdim=None,
      vdim=None,
      dropout=0.0,
      activation=nn.ReLU,
      normalize_before=False,
      causal=False,
      attention_type="regularMHA",
  ):
      super().__init__()
      self.layers = torch.nn.ModuleList(
          [
              TransformerDecoderLayer(
                  d_ffn=d_ffn,
                  nhead=nhead,
                  d_model=d_model,
                  kdim=kdim,
                  vdim=vdim,
                  dropout=dropout,
                  activation=activation,
                  normalize_before=normalize_before,
                  causal=causal,
                  attention_type=attention_type,
              )
              for _ in range(num_layers)
          ]
      )
      self.norm = sb.nnet.normalization.LayerNorm(d_model, eps=1e-6)
  
imports: import math
  import torch
  import torch.nn
  import speechbrain
  from typing import Optional
  import numpy
  from .Conformer import ConformerEncoder
  from .Branchformer import BranchformerEncoder
  from speechbrain.nnet.activations import Swish
  from speechbrain.nnet.attention import RelPosEncXL
  from speechbrain.nnet.CNN import Conv1d
label_desc: Use image node_id 1 to create a new TransformerDecoder object from inherited base classes: nn with example: obj = TransformerDecoder(num_layers, nhead, d_ffn, d_model, kdim, vdim, dropout, activation, normalize_before, causal, attention_type)