code: public static long vectorsPerSlice(INDArray arr) {
          if (arr.rank() > 2) {
              return ArrayUtil.prodLong(new long[] {arr.size(-1), arr.size(-2)});
          }
  
          return arr.slices();
      }
docs: The number of vectors
  in each slice of an ndarray.
  @param arr the array to
  get the number
  of vectors per slice for
  @return the number of vectors per slice