reduceProd function

VARP reduceProd(
  1. VARP x, {
  2. List<int> axis = const [],
  3. bool keepDims = false,
})

Computes the product of elements across dimensions of a variable.

Reduces input_variable along the dimensions given in axis.

Unless keepdims is true, the rank of the variable is reduced by 1 for each entry in axis.

If keepdims is true, the reduced dimensions are retained with length 1.

If axis is empty, all dimensions are reduced, and a variable with a single element is returned.

Args:

  • input_variable: The variable to reduce. Should have numeric type.
  • axis: The dimensions to reduce. If empty(the default), reduces all dimensions. Must be in the range [-rank(input_variable), rank(input_variable)).
  • keepdims: If true, retains reduced dimensions with length 1.

Returns:

  • The reduced variable, of the same dtype as the input_variable.

Implementation

VARP reduceProd(VARP x, {List<int> axis = const [], bool keepDims = false}) =>
    VARP.fromPointer(C.mnn_expr_ReduceProd(x.ptr, axis.i32.ptr, keepDims));