/** * Get layer output type. * * @param inputType Array of InputTypes * @return output type as InputType * @throws InvalidKerasConfigurationException */ @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.getZeroPaddingLayer().getOutputType(-1, inputType[0]); }
@Override public LayerMemoryReport getMemoryReport(InputType inputType) { InputType outputType = getOutputType(-1, inputType); return new LayerMemoryReport.Builder(layerName, ZeroPaddingLayer.class, inputType, outputType) .standardMemory(0, 0) //No params //Inference and training is same - just output activations, no working memory in addition to that .workingMemory(0, 0, MemoryReport.CACHE_MODE_ALL_ZEROS, MemoryReport.CACHE_MODE_ALL_ZEROS) .cacheMemory(MemoryReport.CACHE_MODE_ALL_ZEROS, MemoryReport.CACHE_MODE_ALL_ZEROS) //No caching .build(); }