docstr: Shapes:
      - x: :math:`[B, T_src, C]`
      - mask: :math: `[B]`
      - speaker_embedding: :math: `[B, C]`
      - encoding: :math: `[B, T_max2, C]`
docstr_tok: ["Shapes",":","-","x",":",":","math",":","`","[","B",",","T_src",",","C","]","`","-","mask",":",":","math",":","`","[","B","]","`","-","speaker_embedding",":",":","math",":","`","[","B",",","C","]","`","-","encoding",":",":","math",":","`","[","B",",","T_max2",",","C","]","`"]
code: def forward(
      self,
      x: torch.Tensor,
      mask: torch.Tensor,
      speaker_embedding: torch.Tensor,
      encoding: torch.Tensor,
  ) -> torch.Tensor:
      """
      Shapes:
          - x: :math:`[B, T_src, C]`
          - mask: :math: `[B]`
          - speaker_embedding: :math: `[B, C]`
          - encoding: :math: `[B, T_max2, C]`
      """
  
      attn_mask = mask.view((mask.shape[0], 1, 1, mask.shape[1]))
      for enc_layer in self.layer_stack:
          x = enc_layer(
              x,
              mask=mask,
              slf_attn_mask=attn_mask,
              speaker_embedding=speaker_embedding,
              encoding=encoding,
          )
      return x
  
imports: import math
  from typing import Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from TTS.tts.layers.delightful_tts.conv_layers import Conv1dGLU, DepthWiseConv1d, PointwiseConv1d
  from TTS.tts.layers.delightful_tts.networks import GLUActivation
label_desc: Use image node_id 2 for calling the Conformer obj's underlying member method code with example usage: obj.forward(x, mask, speaker_embedding, encoding) and returns: x