docs: public static long[] getReducedShape(int[] wholeShape, int[] dimensions) {
          if (isWholeArray(wholeShape, dimensions))
              return new long[] {};
          else if (dimensions.length == 1 && wholeShape.length == 2) {
              val ret = new long[2];
              if (dimensions[0] == 1) {
                  ret[0] = wholeShape[0];
                  ret[1] = 1;
              } else if (dimensions[0] == 0) {
                  ret[0] = 1;
                  ret[1] = wholeShape[1];
              }
              return ret;
          }
  
          return ArrayUtil.toLongArray(ArrayUtil.removeIndex(wholeShape, dimensions));
      }