def _calculate_feature_size(self) -> int:
        """
        Calculates the size of the features after convolution and pooling layers.

        Returns
        -------
        int
            Flattened size of the features after convolution and pooling layers.
        """
        with torch.no_grad():
            dummy_input = torch.ones(1, 1, self.n_chans, self.n_times)
            t_features = [layer(dummy_input) for layer in self.temporal_blocks]
            t_out = torch.cat(t_features, dim=-1)
            t_out = self.batch_temporal_lay(t_out)

            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)

            feature_size = s_out.view(1, -1).size(1)
        return feature_size

        Calculates the size of the features after convolution and pooling layers.

        Returns
        -------
        int
            Flattened size of the features after convolution and pooling layers.
        
braindecode/models/tsinception.py