class_docstr: This is an interface for transformer model.
  Users can modify the attributes and define the forward function as
  needed according to their own tasks.
  The architecture is based on the paper "Attention Is All You Need":
  https://arxiv.org/pdf/1706.03762.pdf
  Arguments
  ----------
  d_model: int
      The number of expected features in the encoder/decoder inputs (default=512).
  nhead: int
      The number of heads in the multi-head attention models (default=8).
  num_encoder_layers: int, optional
      The number of encoder layers in1ì the encoder.
  num_decoder_layers: int, optional
      The number of decoder layers in the decoder.
  dim_ffn: int, optional
      The dimension of the feedforward network model hidden layer.
  dropout: int, optional
      The dropout value.
  activation: torch.nn.Module, optional
      The activation function for Feed-Forward Network layer,
      e.g., relu or gelu or swish.
  custom_src_module: torch.nn.Module, optional
      Module that processes the src features to expected feature dim.
  custom_tgt_module: torch.nn.Module, optional
      Module that processes the src features to expected feature dim.
  positional_encoding: str, optional
      Type of positional encoding used. e.g. 'fixed_abs_sine' for fixed absolute positional encodings.
  normalize_before: bool, optional
      Whether normalization should be applied before or after MHA or FFN in Transformer layers.
      Defaults to True as this was shown to lead to better performance and training stability.
  kernel_size: int, optional
      Kernel size in convolutional layers when Conformer is used.
  bias: bool, optional
      Whether to use bias in Conformer convolutional layers.
  encoder_module: str, optional
      Choose between Branchformer, Conformer and Transformer for the encoder. The decoder is fixed to be a Transformer.
  conformer_activation: torch.nn.Module, optional
      Activation module used after Conformer convolutional layers. E.g. Swish, ReLU etc. it has to be a torch Module.
  branchformer_activation: torch.nn.Module, optional
      Activation module used within the Branchformer Encoder. E.g. Swish, ReLU etc. it has to be a torch Module.
  attention_type: str, optional
      Type of attention layer used in all Transformer or Conformer layers.
      e.g. regularMHA or RelPosMHA.
  max_length: int, optional
      Max length for the target and source sequence in input.
      Used for positional encodings.
  causal: bool, optional
      Whether the encoder should be causal or not (the decoder is always causal).
      If causal the Conformer convolutional layer is causal.
  encoder_kdim: int, optional
      Dimension of the key for the encoder.
  encoder_vdim: int, optional
      Dimension of the value for the encoder.
  decoder_kdim: int, optional
      Dimension of the key for the decoder.
  decoder_vdim: int, optional
      Dimension of the value for the decoder.
  csgu_linear_units: int, optional
      Number of neurons in the hidden linear units of the CSGU Module.
      -> Branchformer
  gate_activation: torch.nn.Module, optional
      Activation function used at the gate of the CSGU module.
      -> Branchformer
  use_linear_after_conv: bool, optional
      If True, will apply a linear transformation of size input_size//2.
      -> Branchformer
docstr: Users should modify this function according to their own tasks.
docstr_tok: ["Users","should","modify","this","function","according","to","their","own","tasks","."]
code: def forward(self, **kwags):
      """Users should modify this function according to their own tasks."""
      raise NotImplementedError
  
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 2 for calling the TransformerInterface obj's underlying member method code with example usage: obj.forward() without return types