ReduceProd#
Domain:
ai.onnxSince version: 18
Computes the product of the input tensor’s elements along the provided axes. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equals 0, then the resulting tensor has the reduced dimension pruned. The axes are provided as an optional second input tensor. Negative axes are supported. If axes is not provided or is empty and noop_with_empty_axes is set to 1, the input tensor is returned unchanged. If axes is not provided or is empty and noop_with_empty_axes is not set, all dimensions are reduced. Reduction over an empty set of values yields 1.
Inputs
data (T): An input tensor.
axes (tensor(int64)): Optional input list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor if noop_with_empty_axes is false, else act as an Identity op when noop_with_empty_axes is true. Accepted range is [-r, r-1] where r = rank(data).
Outputs
reduced (T): Reduced output tensor.
Attributes
keepdims (int): Keep the reduced dimension or not, default 1 means keep reduced dimension.
noop_with_empty_axes (int): Defines behavior if ‘axes’ is empty. Default behavior with ‘false’ is to reduce all axes. When axes is empty and this attribute is set to true, input tensor will not be reduced, and the output tensor would be equivalent to input tensor.
Type Constraints
T: Constrain input and output types to high-precision numeric tensors. Allowed types: tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64).
Differences with previous version (13)#
SchemaDiff: ReduceProd (domain 'ai.onnx')
old version: 13
new version: 18
breaking: yes
Breaking reasons:
input ‘axes’ (added): at position 1; option=Single; type_str=’tensor(int64)’
attribute ‘axes’ (removed): type=INTS; required=False
Inputs:
[BREAKING] added ‘axes’: at position 1; option=Single; type_str=’tensor(int64)’
Attributes:
[BREAKING] removed ‘axes’: type=INTS; required=False
added ‘noop_with_empty_axes’: type=INT; required=False; default=0
Documentation:
line similarity: 0.62 (+3/-2 lines)
--- ReduceProd v13
+++ ReduceProd v18
@@ -1,6 +1,7 @@
Computes the product of the input tensor's elements along the provided axes.
The resulting tensor has the same rank as the input if keepdims equals 1.
If keepdims equals 0, then the resulting tensor has the reduced dimension pruned.
-The axes attribute specifies which dimensions to reduce. Negative axes are supported.
-If axes is not provided, all dimensions are reduced.
+The axes are provided as an optional second input tensor. Negative axes are supported.
+If axes is not provided or is empty and noop_with_empty_axes is set to 1, the input tensor is returned unchanged.
+If axes is not provided or is empty and noop_with_empty_axes is not set, all dimensions are reduced.
Reduction over an empty set of values yields 1.