docs: public void initGradientsView() {
          try (MemoryWorkspace ws = Nd4j.getMemoryManager().scopeOutOfWorkspaces()) {
              if (!initCalled)
                  init();
  
              GraphIndices indices = calculateIndices();
  
              //Go through layers, and work out total number of parameters. Then allocate full parameters array
              long numParams = 0;
              long[] numParamsForVertex = new long[topologicalOrder.length];
              int i = 0;
              for (; i < configuration.getNetworkInputs().size(); i++) {
                  numParamsForVertex[i] = 0; //No parameters for input vertices
              }
              Map<String, org.deeplearning4j.nn.conf.graph.GraphVertex> configVertexMap = configuration.getVertices();
              for (; i < topologicalOrder.length; i++) {
                  String name = indices.getIdxToName().get(i);
                  org.deeplearning4j.nn.conf.graph.GraphVertex n = configVertexMap.get(name);
                  numParamsForVertex[i] = n.numParams(true);
                  numParams += numParamsForVertex[i];
              }
  
              if(numParams > 0) {
                  flattenedGradients = Nd4j.create(flattenedParams.dataType(), 1, numParams);
              }
  
              //Given the topological ordering: work out the subset of the gradient array used for each layer, and set it
              long paramOffsetSoFar = 0;
              i = 0;
              for (int vertexIdx : topologicalOrder) {
                  long nParamsThisVertex = numParamsForVertex[vertexIdx];
                  if (nParamsThisVertex != 0) {
                      INDArray gradientView = flattenedGradients.get(NDArrayIndex.interval(0,0,true),
                              NDArrayIndex.interval(paramOffsetSoFar, paramOffsetSoFar + nParamsThisVertex));
                      vertices[vertexIdx].setBackpropGradientsViewArray(gradientView);
                  }
                  i++;
                  paramOffsetSoFar += nParamsThisVertex;
              }
          }
      }