class_docstr: This class implements the Conformer encoder.
  
  Arguments
  ---------
  num_layers : int
      Number of layers.
  d_model : int
      Embedding dimension size.
  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 Confomer 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_emb = torch.rand((1, 2*60-1, 512))
  >>> net = ConformerEncoder(1, 512, 512, 8)
  >>> output, _ = net(x, pos_embs=pos_emb)
  >>> output.shape
  torch.Size([8, 60, 512])
docstr: Conformer streaming forward (typically for
  DynamicChunkTraining-trained models), which is to be used at inference
  time. Relies on a mutable context object as initialized by
  `make_streaming_context` that should be used across chunks.
  
  Arguments
  ---------
  src : torch.Tensor
      Input tensor. Batching is supported as long as you keep the context
      consistent.
  context: ConformerEncoderStreamingContext
      Mutable streaming context; the same object should be passed across
      calls.
  pos_embs: torch.Tensor, optional
      Positional embeddings, if used.
docstr_tok: ["Conformer","streaming","forward","(","typically","for","DynamicChunkTraining-trained","models",")",",","which","is","to","be","used","at","inference","time",".","Relies","on","a","mutable","context","object","as","initialized","by","`","make_streaming_context","`","that","should","be","used","across","chunks",".","Arguments","--","--","--","--","-","src",":","torch.Tensor","Input","tensor",".","Batching","is","supported","as","long","as","you","keep","the","context","consistent",".","context",":","ConformerEncoderStreamingContext","Mutable","streaming","context",";","the","same","object","should","be","passed","across","calls",".","pos_embs",":","torch.Tensor",",","optional","Positional","embeddings",",","if","used","."]
code: def forward_streaming(
      self,
      src: torch.Tensor,
      context: ConformerEncoderStreamingContext,
      pos_embs: Optional[torch.Tensor] = None,
  ):
      """Conformer streaming forward (typically for
      DynamicChunkTraining-trained models), which is to be used at inference
      time. Relies on a mutable context object as initialized by
      `make_streaming_context` that should be used across chunks.
  
      Arguments
      ---------
      src : torch.Tensor
          Input tensor. Batching is supported as long as you keep the context
          consistent.
      context: ConformerEncoderStreamingContext
          Mutable streaming context; the same object should be passed across
          calls.
      pos_embs: torch.Tensor, optional
          Positional embeddings, if used."""
  
      if self.attention_type == "RelPosMHAXL":
          if pos_embs is None:
              raise ValueError(
                  "The chosen attention type for the Conformer is RelPosMHAXL. For this attention type, the positional embeddings are mandatory"
              )
  
      output = src
      attention_lst = []
      for i, enc_layer in enumerate(self.layers):
          output, attention = enc_layer.forward_streaming(
              output, pos_embs=pos_embs, context=context.layers[i]
          )
          attention_lst.append(attention)
      output = self.norm(output)
  
      return output, attention_lst
  
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 3 for calling the ConformerEncoder obj's underlying member method code with example usage: obj.forward_streaming(src, context, pos_embs) and returns: output,  attention_lst