src/transformers/models/mctct/modeling_mctct.py/MCTCTConv1dSubsampler/__init__
class MCTCTConv1dSubsampler:    def __init__(self, config):
        super().__init__()
        self.config = config
        self.glu_dim = config.conv_glu_dim

        self.dropout = nn.Dropout(config.conv_dropout)

        self.num_layers = config.num_conv_layers
        self.in_channels = config.input_feat_per_channel * config.input_channels

        if self.num_layers > 1:
            if config.conv_channels is None:
                raise ValueError(
                    "Need to specify `conv_channels` configuration in `MCTCTConfig` to use multiple convolution"
                    " layers."
                )

            self.mid_channels = config.conv_channels
        else:
            self.mid_channels = None

        self.out_channels = config.hidden_size * 2  # considering GLU halving
        self.kernel_size = config.conv_kernel
        self.stride = config.conv_stride

        # NOTE: MCTCT by construction only uses one convolution kernel. I've made this flexible to allow for
        # multiple layers of convolutions, but not sure if this model definition should just restrict it
        # to one layer. This becomes especially relevant when considering the padding like line 1 of forward().
        self.conv_layers = nn.ModuleList(
            nn.Conv1d(
                self.in_channels if i == 0 else self.mid_channels[i],
                self.mid_channels[i] if i < self.num_layers - 1 else self.out_channels,
                kernel_size=k,
                stride=self.stride[i],
                padding="valid",
            )
            for i, k in enumerate(self.kernel_size)
        )