def forward(self, x: torch.Tensor) -> torch.Tensor:
        """
        Forward pass of the FBCNet model.

        Parameters
        ----------
        x : torch.Tensor
            Input tensor with shape (batch_size, n_chans, n_times).

        Returns
        -------
        torch.Tensor
            Output tensor with shape (batch_size, n_outputs).
        """
        # output: (batch_size, n_chans, n_times)
        x = self.spectral_filtering(x)

        # output: (batch_size, n_bands, n_chans, n_times)
        x = self.spatial_conv(x)
        batch_size, channels, _, _ = x.shape

        # shape: (batch_size, n_filters_spat * n_bands, 1, n_times)
        x = self.padding_layer(x)

        # shape: (batch_size, n_filters_spat * n_bands, 1, n_times_padded)
        x = x.view(
            batch_size,
            channels,
            self.stride_factor,
            self.n_times_padded // self.stride_factor,
        )
        # shape: batch_size, n_filters_spat * n_bands, stride, n_times_padded/stride
        x = self.temporal_layer(x)  # type: ignore[operator]

        # shape: batch_size, n_filters_spat * n_bands, stride, 1
        x = self.flatten_layer(x)

        # shape: batch_size, n_filters_spat * n_bands * stride
        x = self.final_layer(x)
        # shape: batch_size, n_outputs
        return x

        Forward pass of the FBCNet model.

        Parameters
        ----------
        x : torch.Tensor
            Input tensor with shape (batch_size, n_chans, n_times).

        Returns
        -------
        torch.Tensor
            Output tensor with shape (batch_size, n_outputs).
        
braindecode/models/fbcnet.py