class_docstr: This is an implementation of Conformer encoder layer.
  
  Arguments
  ----------
  d_model : int
      The expected size of the input embedding.
  d_ffn : int
      Hidden size of self-attention Feed Forward layer.
  nhead : int
      Number of attention heads.
  kernel_size : int, optional
      Kernel size of convolution model.
  kdim : int, optional
      Dimension of the key.
  vdim : int, optional
      Dimension of the value.
  activation: torch.nn.Module
       Activation function used in each Conformer layer.
  bias : bool, optional
      Whether  convolution module.
  dropout : int, optional
      Dropout for the encoder.
  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
  -------
  >>> import torch
  >>> x = torch.rand((8, 60, 512))
  >>> pos_embs = torch.rand((1, 2*60-1, 512))
  >>> net = ConformerEncoderLayer(d_ffn=512, nhead=8, d_model=512, kernel_size=3)
  >>> output = net(x, pos_embs=pos_embs)
  >>> output[0].shape
  torch.Size([8, 60, 512])
docstr: Arguments
  ----------
  src : torch.Tensor
      The sequence to the encoder layer.
  src_mask : torch.Tensor, optional
      The mask for the src sequence.
  src_key_padding_mask : torch.Tensor, optional
      The mask for the src keys per batch.
  pos_embs: torch.Tensor, torch.nn.Module, optional
      Module or tensor containing the input sequence positional embeddings
  dynchunktrain_config: Optional[DynChunkTrainConfig]
      Dynamic Chunk Training configuration object for streaming,
      specifically involved here to apply Dynamic Chunk Convolution to
      the convolution module.
docstr_tok: ["Arguments","--","--","--","--","--","src",":","torch.Tensor","The","sequence","to","the","encoder","layer",".","src_mask",":","torch.Tensor",",","optional","The","mask","for","the","src","sequence",".","src_key_padding_mask",":","torch.Tensor",",","optional","The","mask","for","the","src","keys","per","batch",".","pos_embs",":","torch.Tensor",",","torch.nn.Module",",","optional","Module","or","tensor","containing","the","input","sequence","positional","embeddings","dynchunktrain_config",":","Optional","[","DynChunkTrainConfig","]","Dynamic","Chunk","Training","configuration","object","for","streaming",",","specifically","involved","here","to","apply","Dynamic","Chunk","Convolution","to","the","convolution","module","."]
code: def forward(
      self,
      x,
      src_mask: Optional[torch.Tensor] = None,
      src_key_padding_mask: Optional[torch.Tensor] = None,
      pos_embs: torch.Tensor = None,
      dynchunktrain_config: Optional[DynChunkTrainConfig] = None,
  ):
      """
      Arguments
      ----------
      src : torch.Tensor
          The sequence to the encoder layer.
      src_mask : torch.Tensor, optional
          The mask for the src sequence.
      src_key_padding_mask : torch.Tensor, optional
          The mask for the src keys per batch.
      pos_embs: torch.Tensor, torch.nn.Module, optional
          Module or tensor containing the input sequence positional embeddings
      dynchunktrain_config: Optional[DynChunkTrainConfig]
          Dynamic Chunk Training configuration object for streaming,
          specifically involved here to apply Dynamic Chunk Convolution to
          the convolution module.
      """
      conv_mask: Optional[torch.Tensor] = None
      if src_key_padding_mask is not None:
          conv_mask = src_key_padding_mask.unsqueeze(-1)
      # ffn module
      x = x + 0.5 * self.ffn_module1(x)
      # muti-head attention module
      skip = x
      x = self.norm1(x)
  
      x, self_attn = self.mha_layer(
          x,
          x,
          x,
          attn_mask=src_mask,
          key_padding_mask=src_key_padding_mask,
          pos_embs=pos_embs,
      )
      x = x + skip
      # convolution module
      x = x + self.convolution_module(
          x, conv_mask, dynchunktrain_config=dynchunktrain_config
      )
      # ffn module
      x = self.norm2(x + 0.5 * self.ffn_module2(x))
      return x, self_attn
  
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 ConformerEncoderLayer obj's underlying member method code with example usage: obj.forward(x, src_mask, src_key_padding_mask, pos_embs, dynchunktrain_config) and returns: x,  self_attn