def forward(self, x, *, mask=None):
        """
        Forward pass for the Mossformer Block with Gated FSMN.
        
        Args:
            x (Tensor): Input tensor of shape (batch_size, dim, sequence_length).
            mask (Tensor, optional): Mask tensor for attention operations.
        
        Returns:
            Tensor: Output tensor after processing through the block.
        """
        ii = 0
        for flash in self.layers:  # Process through each layer
            x = flash(x, mask=mask)
            x = self.fsmn[ii](x)  # Apply corresponding Gated FSMN block
            ii += 1
            
        return x

        Forward pass for the Mossformer Block with Gated FSMN.
        
        Args:
            x (Tensor): Input tensor of shape (batch_size, dim, sequence_length).
            mask (Tensor, optional): Mask tensor for attention operations.
        
        Returns:
            Tensor: Output tensor after processing through the block.
        
clearvoice/clearvoice/models/mossformer2_se/mossformer2_block.py