code: public static int[] shape(INDArrayIndex... indices) {
          int[] ret = new int[indices.length];
          for (int i = 0; i < ret.length; i++) {
              // FIXME: LONG
              ret[i] = (int) indices[i].length();
          }
  
          List<Integer> nonZeros = new ArrayList<>();
          for (int i = 0; i < ret.length; i++) {
              if (ret[i] > 0)
                  nonZeros.add(ret[i]);
          }
  
          return ArrayUtil.toArray(nonZeros);
      }
docs: Calculate the shape for the given set of indices.
  <p/>
  The shape is defined as (for each dimension)
  the difference between the end index + 1 and
  the begin index
  
  @param indices the indices to calculate the shape for
  @return the shape for the given indices