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])
docstr: Returns the transformed output.
  
  Arguments
  ---------
  x : torch.Tensor
      Tensor shape [B, L, N],
      where, B = Batchsize,
             L = time points
             N = number of filters
docstr_tok: ["Returns","the","transformed","output",".","Arguments","--","--","--","--","-","x",":","torch.Tensor","Tensor","shape","[","B",",","L",",","N","]",",","where",",","B","=","Batchsize",",","L","=","time","points","N","=","number","of","filters"]
code: def forward(self, x):
      """Returns the transformed output.
  
      Arguments
      ---------
      x : torch.Tensor
          Tensor shape [B, L, N],
          where, B = Batchsize,
                 L = time points
                 N = number of filters
      """
      src_mask = get_lookahead_mask(x) if self.causal else None
  
      if self.use_positional_encoding:
          pos_enc = self.pos_enc(x)
          out = self.mdl(x + pos_enc, src_mask=src_mask)[0]
      else:
          out = self.mdl(x, src_mask=src_mask)[0]
  
      if self.use_norm:
          out = self.norm(out.permute(0, 2, 1)).permute(0, 2, 1)
      if self.use_skip:
          out = out + x
  
      return out
  
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 2 for calling the SBTransformerBlock_wnormandskip obj's underlying member method code with example usage: obj.forward(x) and returns: out