code: public static int getLd(INDArray arr) {
          //ignore ordering for vectors
          if (arr.isVector()) {
              return (int) arr.length();
          }
  
          return arr.ordering() == NDArrayFactory.C ? (int) arr.size(1) : (int) arr.size(0);
      }
docs: Get the leading dimension
  for a blas invocation.
  
  The lead dimension is usually
  arr.size(0) (this is only for fortran ordering though).
  It can be size(1) (assuming matrix) for C ordering though.
  @param arr the array to
  @return the leading dimension wrt the ordering of the array