docs: public void initGradientsView() {
          try (MemoryWorkspace ws = Nd4j.getMemoryManager().scopeOutOfWorkspaces()) {
              if (layers == null)
                  init();
  
              int nLayers = layers.length;
  
              //First: Work out total length of params
              long paramLength = 0;
              val nParamsPerLayer = new long[nLayers];
              for (int i = 0; i < nLayers; i++) {
                  NeuralNetConfiguration conf = layerWiseConfigurations.getConf(i);
                  nParamsPerLayer[i] = conf.getLayer().initializer().numParams(conf);
                  paramLength += nParamsPerLayer[i];
              }
  
              if(paramLength > 0) {
                  flattenedGradients = Nd4j.create(flattenedParams.dataType(), new long[]{1, paramLength}, 'f'); //No need to initialize, as each layer will do it each iteration anyway
              }
  
              long paramsSoFar = 0;
              for (int i = 0; i < layers.length; i++) {
                  if (nParamsPerLayer[i] == 0)
                      continue; //This layer doesn't have any parameters...
                  INDArray thisLayerGradView = flattenedGradients.get(NDArrayIndex.interval(0,0,true),
                          NDArrayIndex.interval(paramsSoFar, paramsSoFar + nParamsPerLayer[i]));
                  layers[i].setBackpropGradientsViewArray(thisLayerGradView);
                  paramsSoFar += nParamsPerLayer[i];
              }
          }
      }