docs: public INDArray output(DataSetIterator iterator, boolean train) {
          List<INDArray> outList = new ArrayList<>();
          long[] firstOutputShape = null;
          while (iterator.hasNext()) {
              DataSet next = iterator.next();
              INDArray features = next.getFeatures();
  
              if (features == null)
                  continue;
  
              INDArray fMask = next.getFeaturesMaskArray();
              INDArray lMask = next.getLabelsMaskArray();
              INDArray output = this.output(features, train, fMask, lMask);
              outList.add(output);
              if(firstOutputShape == null){
                  firstOutputShape = output.shape();
              } else {
                  //Validate that shapes are the same (may not be, for some RNN variable length time series applications)
                  long[] currShape = output.shape();
                  Preconditions.checkState(firstOutputShape.length == currShape.length, "Error during forward pass:" +
                          "different minibatches have different output array ranks - first minibatch shape %s, last minibatch shape %s", firstOutputShape, currShape);
                  for( int i=1; i<currShape.length; i++ ){    //Skip checking minibatch dimension, fine if this varies
                      Preconditions.checkState(firstOutputShape[i] == currShape[i], "Current output shape does not match first" +
                              " output array shape at position %s: all dimensions must match other than the first dimension.\n" +
                              " For variable length output size/length use cases such as for RNNs with multiple sequence lengths," +
                              " use one of the other (non iterator) output methods. First batch output shape: %s, current batch output shape: %s",
                              i, firstOutputShape, currShape);
                  }
              }
          }
          return Nd4j.concat(0, outList.toArray(new INDArray[outList.size()]));
      }