docs: public static INDArray toArray(Collection<? extends Writable> record) {
          List<Writable> l;
          if(record instanceof List){
              l = (List<Writable>)record;
          } else {
              l = new ArrayList<>(record);
          }
  
          //Edge case: single NDArrayWritable
          if(l.size() == 1 && l.get(0) instanceof NDArrayWritable){
              return ((NDArrayWritable) l.get(0)).get();
          }
  
          int length = 0;
          for (Writable w : record) {
              if (w instanceof NDArrayWritable) {
                  INDArray a = ((NDArrayWritable) w).get();
                  if (!a.isRowVector()) {
                      throw new UnsupportedOperationException("Multiple writables present but NDArrayWritable is "
                              + "not a row vector. Can only concat row vectors with other writables. Shape: "
                              + Arrays.toString(a.shape()));
                  }
                  length += a.length();
              } else {
                  //Assume all others are single value
                  length++;
              }
          }
  
          INDArray arr = Nd4j.create(1, length);
  
          int k = 0;
          for (Writable w : record ) {
              if (w instanceof NDArrayWritable) {
                  INDArray toPut = ((NDArrayWritable) w).get();
                  arr.put(new INDArrayIndex[] {NDArrayIndex.point(0),
                          NDArrayIndex.interval(k, k + toPut.length())}, toPut);
                  k += toPut.length();
              } else {
                  arr.putScalar(0, k, w.toDouble());
                  k++;
              }
          }
  
          return arr;
      }