@Override
public LayerMemoryReport getMemoryReport(InputType inputType) {
InputType.InputTypeConvolutional c = (InputType.InputTypeConvolutional) inputType;
InputType.InputTypeConvolutional outputType = (InputType.InputTypeConvolutional) getOutputType(-1, inputType);
int actElementsPerEx = outputType.arrayElementsPerExample();
int im2colSizePerEx =
c.getDepth() * outputType.getHeight() * outputType.getWidth() * kernelSize[0] * kernelSize[1];
int trainingWorkingSizePerEx = im2colSizePerEx;
if (getDropOut() > 0) {
trainingWorkingSizePerEx += inputType.arrayElementsPerExample();
}
return new LayerMemoryReport.Builder(layerName, SubsamplingLayer.class, inputType, outputType)
.standardMemory(0, 0)
.workingMemory(0, im2colSizePerEx, 0, trainingWorkingSizePerEx)
.cacheMemory(MemoryReport.CACHE_MODE_ALL_ZEROS, MemoryReport.CACHE_MODE_ALL_ZEROS)
.build();
}