class_docstr: A wrapper for the SpeechBrain implementation of the transformer encoder.
  
  Arguments
  ---------
  num_layers : int
      Number of layers.
  d_model : int
      Dimensionality of the representation.
  nhead : int
      Number of attention heads.
  d_ffn : int
      Dimensionality of positional feed forward.
  input_shape : tuple
      Shape of input.
  kdim : int
      Dimension of the key (Optional).
  vdim : int
      Dimension of the value (Optional).
  dropout : float
      Dropout rate.
  activation : str
      Activation function.
  use_positional_encoding : bool
      If true we use a positional encoding.
  norm_before: bool
      Use normalization before transformations.
  
  Example
  ---------
  >>> x = torch.randn(10, 100, 64)
  >>> block = SBTransformerBlock_wnormandskip(1, 64, 8)
  >>> x = block(x)
  >>> x.shape
  torch.Size([10, 100, 64])
code: def __init__(
      self,
      num_layers,
      d_model,
      nhead,
      d_ffn=2048,
      input_shape=None,
      kdim=None,
      vdim=None,
      dropout=0.1,
      activation="relu",
      use_positional_encoding=False,
      norm_before=False,
      attention_type="regularMHA",
      causal=False,
      use_norm=True,
      use_skip=True,
      norm_type="gln",
  ):
      super(SBTransformerBlock_wnormandskip, self).__init__()
      self.use_positional_encoding = use_positional_encoding
  
      if activation == "relu":
          activation = nn.ReLU
      elif activation == "gelu":
          activation = nn.GELU
      else:
          raise ValueError("unknown activation")
  
      self.causal = causal
  
      self.mdl = TransformerEncoder(
          num_layers=num_layers,
          nhead=nhead,
          d_ffn=d_ffn,
          input_shape=input_shape,
          d_model=d_model,
          kdim=kdim,
          vdim=vdim,
          dropout=dropout,
          activation=activation,
          normalize_before=norm_before,
          causal=causal,
          attention_type=attention_type,
      )
  
      self.use_norm = use_norm
      self.use_skip = use_skip
  
      if use_norm:
          self.norm = select_norm(
              norm=norm_type, dim=d_model, shape=3, eps=EPS
          )
  
      if use_positional_encoding:
          self.pos_enc = PositionalEncoding(
              input_size=d_model, max_len=100000
          )
  
imports: import torch
  import torch.nn
  from speechbrain.lobes.models.dual_path import select_norm
  from speechbrain.lobes.models.transformer.Transformer import TransformerEncoder, PositionalEncoding, get_lookahead_mask
  import speechbrain.nnet.RNN
  import copy
label_desc: Use image node_id 1 to create a new SBTransformerBlock_wnormandskip object from inherited base classes: nn with example: obj = SBTransformerBlock_wnormandskip(num_layers, d_model, nhead, d_ffn, input_shape, kdim, vdim, dropout, activation, use_positional_encoding, norm_before, attention_type, causal, use_norm, use_skip, norm_type)