Reduce
The reduce operator has a collection of basic reduce calculation, like reduce sum and reduce multiplication.
A reduce operator do reduce calculation along axis in attribute axis
.
Few notes:
- The
inputTensors
andoutputTensors
should have same number of tensors.
Initialization
Reduce operators requires user specifying the axis
let op = SomeReduceOperator(axis:[1], keepDim: false)
keepDim
is optional. Its default values is false
.
Value of keepDim
indicates if keep dimensions in result tensor and this just affects result tensor's shape
attributes.
List
ReduceSumOperator
Computes the sum of array elements over given axes.
ReduceProductOperator
Computes the product of array elements over given axes.
ReduceMaxOperator
Computes the max of array elements over given axes.
ReduceMinOperator
Computes the min of array elements over given axes.
ReduceMeanOperator
Computes the mean of array elements over given axes.