docs: @Override
      public InputPreProcessor getInputPreprocessor(InputType... inputType) throws InvalidKerasConfigurationException {
          if (inputType.length > 1)
              throw new InvalidKerasConfigurationException(
                      "Keras Flatten layer accepts only one input (received " + inputType.length + ")");
          InputPreProcessor preprocessor = null;
          if (inputType[0] instanceof InputTypeConvolutional) {
              InputTypeConvolutional it = (InputTypeConvolutional) inputType[0];
              switch (this.getDimOrder()) {
                  case NONE:
                  case THEANO:
                      preprocessor = new CnnToFeedForwardPreProcessor(it.getHeight(), it.getWidth(), it.getChannels());
                      break;
                  case TENSORFLOW:
                      preprocessor = new TensorFlowCnnToFeedForwardPreProcessor(it.getHeight(), it.getWidth(),
                              it.getChannels());
                      break;
                  default:
                      throw new InvalidKerasConfigurationException("Unknown Keras backend " + this.getDimOrder());
              }
          } else if (inputType[0] instanceof InputType.InputTypeRecurrent) {
              InputType.InputTypeRecurrent it = (InputType.InputTypeRecurrent) inputType[0];
              preprocessor = new KerasFlattenRnnPreprocessor(it.getSize(), it.getTimeSeriesLength());
          } else if (inputType[0] instanceof InputType.InputTypeFeedForward) {
              // NOTE: The output of an embedding layer in DL4J is of feed-forward type. Only if an FF to RNN input
              // preprocessor is set or we explicitly provide 3D input data to start with, will the its output be set
              // to RNN type. Otherwise we add this trivial preprocessor (since there's nothing to flatten).
              InputType.InputTypeFeedForward it = (InputType.InputTypeFeedForward) inputType[0];
              val inputShape = new long[]{it.getSize()};
              preprocessor = new ReshapePreprocessor(inputShape, inputShape);
          }
          return preprocessor;
      }