def METHOD_NAME(self, input_shape, **kwargs):
    """Construct a network and return its input and output layers.
    Arguments
    ---------
    input_shape : tuple
        The shape of the data fed into the input layer
    Returns
    -------
    input_layer : a keras layer
    output_layer : a keras layer
    """
    from tensorflow import keras
    fs = self._filter_sizes
    nconv = self.n_conv_layers
    padding = self.padding
    # this is the condition from the original implementation
    if padding == "auto":
        if input_shape[0] < 60:
            padding = "same"
        else:
            padding = "valid"
    # Extends filter_sizes to match n_conv_layers length
    filter_sizes = fs[:nconv] + [fs[-1]] * max(0, nconv - len(fs))
    input_layer = keras.layers.Input(input_shape)
    conv = keras.layers.Conv1D(
        filters=filter_sizes[0],
        kernel_size=self.kernel_size,
        padding=padding,
        activation=self.activation,
    )(input_layer)
    conv = keras.layers.AveragePooling1D(pool_size=self.avg_pool_size)(conv)
    for i in range(1, self.n_conv_layers):
        conv = keras.layers.Conv1D(
            filters=filter_sizes[i],
            kernel_size=self.kernel_size,
            padding=padding,
            activation=self.activation,
        )(conv)
        conv = keras.layers.AveragePooling1D(pool_size=self.avg_pool_size)(conv)
    flatten_layer = keras.layers.Flatten()(conv)
    return input_layer, flatten_layer