public NetworkMemoryReport getMemoryReport(InputType... inputTypes) {


        Map<String, MemoryReport> memoryReportMap = new LinkedHashMap<>();
        List<String> topologicalOrdering = topologicalOrdering();

        Map<String, InputType> vertexOutputs = new HashMap<>();
        int currLayerIdx = -1;
        for (String s : topologicalOrdering) {
            int inputIdx = networkInputs.indexOf(s);
            if (inputIdx != -1) {
                vertexOutputs.put(s, inputTypes[inputIdx]);
                continue;
            }

            GraphVertex gv = vertices.get(s);

            List<InputType> inputTypeList = new ArrayList<>();

            if (gv instanceof LayerVertex) {
                //Add preprocessor, if necessary:
                String in = vertexInputs.get(s).get(0);
                InputType layerInput = vertexOutputs.get(in);
                inputTypeList.add(layerInput);
                currLayerIdx++;
            } else {
                List<String> inputs = vertexInputs.get(s);
                if (inputs != null) {
                    for (String inputVertexName : inputs) {
                        inputTypeList.add(vertexOutputs.get(inputVertexName));
                    }
                }
            }



            InputType outputFromVertex =
                            gv.getOutputType(currLayerIdx, inputTypeList.toArray(new InputType[inputTypeList.size()]));
            vertexOutputs.put(s, outputFromVertex);

            MemoryReport mr = gv.getMemoryReport(inputTypeList.toArray(new InputType[inputTypeList.size()]));

            memoryReportMap.put(s, mr);
        }

        return new NetworkMemoryReport(memoryReportMap, ComputationGraphConfiguration.class, "ComputationGraph",
                        inputTypes);
    }
public NetworkMemoryReport getMemoryReport ( InputType ... inputTypes ) { Map < String , MemoryReport > memoryReportMap = new LinkedHashMap < > ( ) ; List < String > topologicalOrdering = topologicalOrdering ( ) ; Map < String , InputType > vertexOutputs = new HashMap < > ( ) ; int currLayerIdx = - 1 ; for ( String s : topologicalOrdering ) { int inputIdx = networkInputs . indexOf ( s ) ; if ( inputIdx != - 1 ) { vertexOutputs . put ( s , inputTypes [ inputIdx ] ) ; continue ; } GraphVertex gv = vertices . get ( s ) ; List < InputType > inputTypeList = new ArrayList < > ( ) ; if ( gv instanceof LayerVertex ) { String in = vertexInputs . get ( s ) . get ( 0 ) ; InputType layerInput = vertexOutputs . get ( in ) ; inputTypeList . add ( layerInput ) ; currLayerIdx ++ ; } else { List < String > inputs = vertexInputs . get ( s ) ; if ( inputs != null ) { for ( String inputVertexName : inputs ) { inputTypeList . add ( vertexOutputs . get ( inputVertexName ) ) ; } } } InputType outputFromVertex = gv . getOutputType ( currLayerIdx , inputTypeList . toArray ( new InputType [ inputTypeList . size ( ) ] ) ) ; vertexOutputs . put ( s , outputFromVertex ) ; MemoryReport mr = gv . getMemoryReport ( inputTypeList . toArray ( new InputType [ inputTypeList . size ( ) ] ) ) ; memoryReportMap . put ( s , mr ) ; } return new NetworkMemoryReport ( memoryReportMap , ComputationGraphConfiguration . class , "ComputationGraph" , inputTypes ) ; }
Get a {@link MemoryReport} for the given computation graph configuration. This is used to estimate the
memory requirements for the given network configuration and input

@param inputTypes Input types for the network
@return Memory report for the network