docs: @Override
      public InputPreProcessor getInputPreprocessor(InputType... inputType) throws InvalidKerasConfigurationException {
          if (inputType.length > 1)
              throw new InvalidKerasConfigurationException(
                      "Keras Reshape layer accepts only one input (received " + inputType.length + ")");
          InputPreProcessor preprocessor = null;
          if (inputType[0] instanceof InputType.InputTypeConvolutional) {
              InputType.InputTypeConvolutional it = (InputType.InputTypeConvolutional) inputType[0];
              val inputShape = new long[]{it.getChannels(), it.getHeight(), it.getWidth()};
              val dimOrder = getDimOrder();
              if (dimOrder == DimOrder.THEANO || dimOrder == DimOrder.NONE && kerasMajorVersion == 1) {
                  if (targetShape.length == 2) { // edge caseKeras
                      targetShape = new long[]{targetShape[1], targetShape[0]};
                  } else {
                      targetShape = new long[]{targetShape[1], targetShape[0], targetShape[2]};
                  }
                  preprocessor = new ReshapePreprocessor(inputShape, targetShape);
              } else { // (dimOrder == DimOrder.TENSORFLOW || dimOrder == DimOrder.NONE && kerasMajorVersion == 2)
                  if (inputShape[0] != targetShape[0])
                      targetShape = new long[]{targetShape[2], targetShape[0], targetShape[1]};
                  preprocessor = new ReshapePreprocessor(inputShape, targetShape);
              }
  
          } else if (inputType[0] instanceof InputType.InputTypeConvolutional3D) {
              InputType.InputTypeConvolutional3D it = (InputType.InputTypeConvolutional3D) inputType[0];
              val inputShape = new long[] { it.getDepth(), it.getHeight(), it.getWidth(), it.getChannels() };
              val dimOrder = getDimOrder();
              if (dimOrder == DimOrder.THEANO || dimOrder == DimOrder.NONE && kerasMajorVersion == 1) {
                  if (targetShape.length == 3) { // Keras edge case
                      targetShape = new long[] { targetShape[1], targetShape[0], targetShape[2] };
                  } else {
                      targetShape = new long[] { targetShape[2], targetShape[1], targetShape[0], targetShape[3] };
                  }
                  preprocessor = new ReshapePreprocessor(inputShape, targetShape);
              } else {
                  if (inputShape[0] != targetShape[0])
                      targetShape = new long[] { targetShape[3], targetShape[0], targetShape[1], targetShape[2] };
                  preprocessor = new ReshapePreprocessor(inputShape, targetShape);
              }
          }  else if (inputType[0] instanceof InputType.InputTypeRecurrent) {
              InputType.InputTypeRecurrent it = (InputType.InputTypeRecurrent) inputType[0];
              val inputShape = new long[]{it.getSize(), it.getTimeSeriesLength()};
              preprocessor = new ReshapePreprocessor(inputShape, this.targetShape);
          } else if (inputType[0] instanceof InputType.InputTypeFeedForward) {
              InputType.InputTypeFeedForward it = (InputType.InputTypeFeedForward) inputType[0];
              val inputShape = new long[]{it.getSize()};
              if (targetShape.length == 3) {
                  targetShape = targetShapeForDimOrder(inputShape, targetShape);
              }
              preprocessor = new ReshapePreprocessor(inputShape, this.targetShape);
          }
          return preprocessor;
      }