code: public static INDArray toMatrix(Matrix arr) {
  
          // we assume that Matrix always has F order
          return Nd4j.create(arr.toArray(), new int[] {arr.numRows(), arr.numCols()}, 'f');
      }
docs: Convert an ndarray to a matrix.
  Note that the matrix will be con
  @param arr the array
  @return an mllib vector