docs: @Override
      public INDArray computeScoreForExamples(double fullNetRegTerm, LayerWorkspaceMgr workspaceMgr) {
          //For RNN: need to sum up the score over each time step before returning.
  
          if (input == null || labels == null)
              throw new IllegalStateException("Cannot calculate score without input and labels " + layerId());
  
          INDArray input2d = TimeSeriesUtils.reshape3dTo2d(input, workspaceMgr, ArrayType.FF_WORKING_MEM);
          INDArray labels2d = TimeSeriesUtils.reshape3dTo2d(labels, workspaceMgr, ArrayType.FF_WORKING_MEM);
  
          INDArray maskReshaped;
          if(this.maskArray != null){
              if(this.maskArray.rank() == 3){
                  maskReshaped = TimeSeriesUtils.reshapePerOutputTimeSeriesMaskTo2d(this.maskArray, workspaceMgr, ArrayType.FF_WORKING_MEM);
              } else {
                  maskReshaped = TimeSeriesUtils.reshapeTimeSeriesMaskToVector(this.maskArray, workspaceMgr, ArrayType.FF_WORKING_MEM);
              }
          } else {
              maskReshaped = null;
          }
  
          ILossFunction lossFunction = layerConf().getLossFn();
          INDArray scoreArray =
                  lossFunction.computeScoreArray(labels2d, input2d, layerConf().getActivationFn(), maskReshaped);
          //scoreArray: shape [minibatch*timeSeriesLength, 1]
          //Reshape it to [minibatch, timeSeriesLength] then sum over time step
  
          // FIXME: int cast
          INDArray scoreArrayTs = TimeSeriesUtils.reshapeVectorToTimeSeriesMask(scoreArray, (int) input.size(0));
          INDArray summedScores = scoreArrayTs.sum(1);
  
          if (fullNetRegTerm != 0.0) {
              summedScores.addi(fullNetRegTerm);
          }
  
          return summedScores;
      }