docs: public static Matrix toMatrix(INDArray arr) {
          if (!arr.isMatrix()) {
              throw new IllegalArgumentException("passed in array must be a matrix");
          }
  
          // if arr is a view - we have to dup anyway
          if (arr.isView()) {
              return Matrices.dense(arr.rows(), arr.columns(), arr.dup('f').data().asDouble());
          } else // if not a view - we must ensure data is F ordered
              return Matrices.dense(arr.rows(), arr.columns(),
                              arr.ordering() == 'f' ? arr.data().asDouble() : arr.dup('f').data().asDouble());
      }