Get layer output type.

@param inputType Array of InputTypes
@return output type as InputType
@throws InvalidKerasConfigurationException Invalid Keras config
354877
public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {
        if (inputType.length > 1)
            throw new InvalidKerasConfigurationException(
                    "Keras SameDiff layer accepts only one input (received " + inputType.length + ")");
        return this.getSameDiffLayer().getOutputType(-1, inputType[0]);
    }
1179251
public static <I extends ImageGray<I>, II extends ImageGray<II>>
	Class<II> getIntegralType( Class<I> inputType ) {
		if( inputType == GrayF32.class ) {
			return (Class<II>)GrayF32.class;
		} else if( inputType == GrayU8.class ){
			return (Class<II>)GrayS32.class;
		} else if( inputType == GrayS32.class ){
			return (Class<II>)GrayS32.class;
		} else {
			throw new IllegalArgumentException("Unknown input image type: "+inputType.getSimpleName());
		}
	}
418372
public static int[] getHWDFromInputType(InputType inputType) {
        int inH;
        int inW;
        int inDepth;

        // FIXME: int cast
        if (inputType instanceof InputType.InputTypeConvolutional) {
            InputType.InputTypeConvolutional conv = (InputType.InputTypeConvolutional) inputType;
            inH = (int) conv.getHeight();
            inW = (int) conv.getWidth();
            inDepth = (int) conv.getChannels();
        } else if (inputType instanceof InputType.InputTypeConvolutionalFlat) {
            InputType.InputTypeConvolutionalFlat conv = (InputType.InputTypeConvolutionalFlat) inputType;
            inH = (int) conv.getHeight();
            inW = (int) conv.getWidth();
            inDepth = (int) conv.getDepth();
        } else {
            throw new IllegalStateException(
                    "Invalid input type: expected InputTypeConvolutional or InputTypeConvolutionalFlat."
                            + " Got: " + inputType);
        }
        return new int[]{inH, inW, inDepth};
    }
1097886
static StructTypeInfo getTypeInfo(Configuration conf) {
    StructTypeInfo inputTypeInfo = (StructTypeInfo) TypeInfoUtils.getTypeInfoFromTypeString(conf.get(INPUT_TYPE_INFO));
    LOG.debug("Got input typeInfo from conf: {}", inputTypeInfo);
    return inputTypeInfo;
  }
310470
@Override
    public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {
        if (inputType.length > 1)
            throw new InvalidKerasConfigurationException(
                    "Keras Subsampling 2D layer accepts only one input (received " + inputType.length + ")");
        return this.getSubsampling2DLayer().getOutputType(-1, inputType[0]);
    }
1575
@Override
    public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {
        if (inputType.length > 1)
            throw new InvalidKerasConfigurationException(
                            "Keras ZeroPadding layer accepts only one input (received " + inputType.length + ")");
        return this.getZeroPadding2DLayer().getOutputType(-1, inputType[0]);
    }
129677
@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;
    }
1122400
public function getOutputTypeOptions($input_type)
    {
        if (!in_array($input_type, $this->types)) {
            $input_type = $this->default_type;
        }
        return $this->map[$input_type];
    }
1039766
public static int getNOutFromConfig(Map<String, Object> layerConfig,
                                        KerasLayerConfiguration conf) throws InvalidKerasConfigurationException {
        Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
        int nOut;
        if (innerConfig.containsKey(conf.getLAYER_FIELD_OUTPUT_DIM()))
            /* Most feedforward layers: Dense, RNN, etc. */
            nOut = (int) innerConfig.get(conf.getLAYER_FIELD_OUTPUT_DIM());
        else if (innerConfig.containsKey(conf.getLAYER_FIELD_EMBEDDING_OUTPUT_DIM()))
            /* Embedding layers. */
            nOut = (int) innerConfig.get(conf.getLAYER_FIELD_EMBEDDING_OUTPUT_DIM());
        else if (innerConfig.containsKey(conf.getLAYER_FIELD_NB_FILTER()))
            /* Convolutional layers. */
            nOut = (int) innerConfig.get(conf.getLAYER_FIELD_NB_FILTER());
        else
            throw new InvalidKerasConfigurationException("Could not determine number of outputs for layer: no "
                    + conf.getLAYER_FIELD_OUTPUT_DIM() + " or " + conf.getLAYER_FIELD_NB_FILTER() + " field found");
        return nOut;
    }
1005645
public Object parseType(String input, Type targetType) {
        return typeParser.parseType(input, targetType);
    }
805153
public java.util.List<? extends org.tensorflow.framework.OpDef.ArgDefOrBuilder> 
      getInputArgOrBuilderList() {
    return inputArg_;
  }
54786
@Override
    public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {
        if (inputType.length > 1)
            throw new InvalidKerasConfigurationException(
                            "Keras LRN layer accepts only one input (received " + inputType.length + ")");
        return this.getLocalResponseNormalization().getOutputType(-1, inputType[0]);
    }
277885
public static <T extends ImageGray<T>>
	InputToBinary<T> threshold( ConfigThreshold config, Class<T> inputType) {

		switch( config.type ) {
			case FIXED:
				return globalFixed(config.fixedThreshold, config.down, inputType);

			case GLOBAL_OTSU:
				return globalOtsu(config.minPixelValue, config.maxPixelValue, config.scale, config.down, inputType);

			case GLOBAL_ENTROPY:
				return globalEntropy(config.minPixelValue, config.maxPixelValue, config.scale, config.down, inputType);

			case GLOBAL_LI:
				return globalLi(config.minPixelValue, config.maxPixelValue, config.scale, config.down, inputType);

			case GLOBAL_HUANG:
				return globalHuang(config.minPixelValue, config.maxPixelValue, config.scale, config.down, inputType);

			case LOCAL_GAUSSIAN:
				return localGaussian(config.width, config.scale, config.down, inputType);

			case LOCAL_SAVOLA:
				return localSauvola(config.width, config.down, config.savolaK, inputType);

			case LOCAL_NICK:
				return localNick(config.width, config.down, config.nickK, inputType);

			case LOCAL_MEAN:
				return localMean(config.width, config.scale, config.down, inputType);

			case LOCAL_OTSU: {
				ConfigThresholdLocalOtsu c = (ConfigThresholdLocalOtsu) config;
				return localOtsu(config.width, config.scale, config.down, c.useOtsu2, c.tuning, inputType);
			}

			case BLOCK_MIN_MAX: {
				ConfigThresholdBlockMinMax c = (ConfigThresholdBlockMinMax) config;
				return blockMinMax(c.width, c.scale , c.down, c.thresholdFromLocalBlocks, c.minimumSpread,
						inputType);
			}

			case BLOCK_MEAN:
				return blockMean(config.width, config.scale , config.down,
						config.thresholdFromLocalBlocks, inputType);

			case BLOCK_OTSU: {
				ConfigThresholdLocalOtsu c = (ConfigThresholdLocalOtsu) config;
				return blockOtsu(c.width, c.scale, c.down, c.thresholdFromLocalBlocks, c.useOtsu2, c.tuning,
						inputType);
			}

		}
		throw new IllegalArgumentException("Unknown type "+config.type);
	}
189769
@Override
    public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {
        if (inputType.length > 1)
            throw new InvalidKerasConfigurationException(
                    "Keras Gaussian Noise layer accepts only one input (received " + inputType.length + ")");
        return this.getGaussianNoiseLayer().getOutputType(-1, inputType[0]);
    }
73041
@Override
    public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {
        if (inputType.length > 1)
            throw new InvalidKerasConfigurationException(
                    "Keras Subsampling 1D layer accepts only one input (received " + inputType.length + ")");
        return this.getSubsampling1DLayer().getOutputType(-1, inputType[0]);
    }
621390
@Override
    public InputType getOutputType(InputType... inputType) throws InvalidKerasConfigurationException {
        if (inputType.length > 1)
            throw new InvalidKerasConfigurationException(
                    "Keras SimpleRnn layer accepts only one input (received " + inputType.length + ")");
        InputPreProcessor preProcessor = getInputPreprocessor(inputType);
        if (preProcessor != null)
            return preProcessor.getOutputType(inputType[0]);
        else
            return this.getSimpleRnnLayer().getOutputType(-1, inputType[0]);
    }
621239
public static String getClassNameFromConfig(Map<String, Object> layerConfig, KerasLayerConfiguration conf)
            throws InvalidKerasConfigurationException {
        if (!layerConfig.containsKey(conf.getLAYER_FIELD_CLASS_NAME()))
            throw new InvalidKerasConfigurationException(
                    "Field " + conf.getLAYER_FIELD_CLASS_NAME() + " missing from layer config");
        return (String) layerConfig.get(conf.getLAYER_FIELD_CLASS_NAME());
    }