code: public static long[] ind2subC(INDArray arr, long index) {
          if (arr.rank() == 1)
              return new long[]{index};
          return ind2subC(arr.shape(), index, ArrayUtil.prodLong(arr.shape()));
      }
docs: Convert a linear index to
  the equivalent nd index based on the shape of the specified ndarray.
  Infers the number of indices from the specified shape.
  
  @param arr the array to compute the indexes
  based on
  @param index the index to map
  @return the mapped indexes along each dimension