docs: public static INDArray toMinibatchArray(@NonNull List<? extends Writable> l) {
          Preconditions.checkArgument(l.size() > 0, "Cannot convert empty list");
  
          //Edge case: single NDArrayWritable
          if(l.size() == 1 && l.get(0) instanceof NDArrayWritable){
              return ((NDArrayWritable) l.get(0)).get();
          }
  
          //Check: all NDArrayWritable or all non-writable
          List<INDArray> toConcat = null;
          DoubleArrayList list = null;
          for (Writable w : l) {
              if (w instanceof NDArrayWritable) {
                  INDArray a = ((NDArrayWritable) w).get();
                  if (a.size(0) != 1) {
                      throw new UnsupportedOperationException("NDArrayWritable must have leading dimension 1 for this " +
                              "method. Received array with shape: " + Arrays.toString(a.shape()));
                  }
                  if(toConcat == null){
                      toConcat = new ArrayList<>();
                  }
                  toConcat.add(a);
              } else {
                  //Assume all others are single value
                  if(list == null){
                      list = new DoubleArrayList();
                  }
                  list.add(w.toDouble());
              }
          }
  
  
          if(toConcat != null && list != null){
              throw new IllegalStateException("Error converting writables: found both NDArrayWritable and single value" +
                      " (DoubleWritable etc) in the one list. All writables must be NDArrayWritables or " +
                      "single value writables only for this method");
          }
  
          if(toConcat != null){
              return Nd4j.concat(0, toConcat.toArray(new INDArray[toConcat.size()]));
          } else {
              return Nd4j.create(list.toArray(new double[list.size()]), new long[]{list.size(), 1}, DataType.FLOAT);
          }
      }