static calcReduceByAxis(input, axes, dims, curAxisInd, pos, op1, op2) {
        let res = 0;
        if (curAxisInd >= axes.length) {
            return op1(input[pos]);
        }
        const axis = axes[curAxisInd];
        const step = axis >= dims.length ? 1 : ShapeUtil.size(dims.slice(axis + 1));
        for (let i = 0; i < dims[axis]; i++) {
            res = i === 0 ? ReduceUtil.calcReduceByAxis(input, axes, dims, curAxisInd + 1, pos, op1, op2) :
                op2(res, ReduceUtil.calcReduceByAxis(input, axes, dims, curAxisInd + 1, pos, op1, op2));
            pos += step;
        }
        return res;
    }
/**
     * Perform reduce operations on the specific operator on specific axes
     * @param a Input tensor data
     * @param axes The dimensions along which the Tensor will be reduced
     * @param dims The input dimension.
     * @param curAxisInd Index in axes specifying the current dimension along
     *      which the tensor will be reduced
     * @param pos The current index of element to perform operation
     * @param op1 The operation to be performed on each element in the tensor
     * @param op2 The operation to be performed between elements in the tensor
     */
Perform reduce operations on the specific operator on specific axes
@param a Input tensor data
@param axes The dimensions along which the Tensor will be reduced
@param dims The input dimension.
@param curAxisInd Index in axes specifying the current dimension along
which the tensor will be reduced
@param pos The current index of element to perform operation
@param op1 The operation to be performed on each element in the tensor
@param op2 The operation to be performed between elements in the tensor
Perform reduce operations on the specific operator on specific axes @param a Input tensor data @param axes The dimensions along which the Tensor will be reduced @param dims The input dimension . @param curAxisInd Index in axes specifying the current dimension along which the tensor will be reduced @param pos The current index of element to perform operation @param op1 The operation to be performed on each element in the tensor @param op2 The operation to be performed between elements in the tensor
static calcReduceByAxis(input, axes, dims, curAxisInd, pos, op1, op2) {
        let res = 0;
        if (curAxisInd >= axes.length) {
            return op1(input[pos]);
        }
        const axis = axes[curAxisInd];
        const step = axis >= dims.length ? 1 : ShapeUtil.size(dims.slice(axis + 1));
        for (let i = 0; i < dims[axis]; i++) {
            res = i === 0 ? ReduceUtil.calcReduceByAxis(input, axes, dims, curAxisInd + 1, pos, op1, op2) :
                op2(res, ReduceUtil.calcReduceByAxis(input, axes, dims, curAxisInd + 1, pos, op1, op2));
            pos += step;
        }
        return res;
    }
static calcReduceByAxis ( input , axes , dims , curAxisInd , pos , op1 , op2 ) { let res = 0 ; if ( curAxisInd >= axes . length ) { return op1 ( input [ pos ] ) ; } const axis = axes [ curAxisInd ] ; const step = axis >= dims . length ? 1 : ShapeUtil . size ( dims . slice ( axis + 1 ) ) ; for ( let i = 0 ; i < dims [ axis ] ; i ++ ) { res = i === 0 ? ReduceUtil . calcReduceByAxis ( input , axes , dims , curAxisInd + 1 , pos , op1 , op2 ) : op2 ( res , ReduceUtil . calcReduceByAxis ( input , axes , dims , curAxisInd + 1 , pos , op1 , op2 ) ) ; pos += step ; } return res ; }
Perform reduce operations on the specific operator on specific axes
 @param a Input tensor data
 @param axes The dimensions along which the Tensor will be reduced
 @param dims The input dimension.
Perform reduce operations on the specific operator on specific axes @param a Input tensor data @param axes The dimensions along which the Tensor will be reduced @param dims The input dimension .