docs: public static double[] getDoubleData(INDArray buf) {
          if (buf.data().dataType() != DataType.DOUBLE)
              throw new IllegalArgumentException("Double data must be obtained from a double buffer");
  
          if (buf.data().allocationMode() == DataBuffer.AllocationMode.HEAP) {
              return buf.data().asDouble();
  
          } else {
              double[] ret = new double[(int) buf.length()];
              INDArray linear = buf.reshape(-1);
              for (int i = 0; i < buf.length(); i++)
                  ret[i] = linear.getDouble(i);
              return ret;
  
          }
      }