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

        Parameters
        ----------
        x : torch.Tensor
            Input tensor of shape (batch_size, n_channels, n_times).

        Returns
        -------
        torch.Tensor
            Output tensor of shape (batch_size, n_classes).
        """
        # Temporal Convolution
        # shape: (batch_size, n_channels, n_times)
        x = self.ensuredim(x)
        # shape: (batch_size, 1, n_channels, n_times)

        t_features = [layer(x) for layer in self.temporal_blocks]
        # shape: (batch_size, number_filter_temp, n_channels,
        #
        t_out = torch.cat(t_features, dim=-1)

        t_out = self.batch_temporal_lay(t_out)

        # Spatial Convolution
        s_out1 = self.spatial_block_1(t_out)
        s_out2 = self.spatial_block_2(t_out)
        s_out = torch.cat((s_out1, s_out2), dim=2)
        s_out = self.batch_spatial_lay(s_out)

        # Flatten and apply final layers
        s_out = s_out.view(s_out.size(0), -1)
        output = self.dense_layer(s_out)
        output = self.final_layer(output)
        return output

        Forward pass of the TSception model.

        Parameters
        ----------
        x : torch.Tensor
            Input tensor of shape (batch_size, n_channels, n_times).

        Returns
        -------
        torch.Tensor
            Output tensor of shape (batch_size, n_classes).
        
braindecode/models/tsinception.py