Function maxElement
Computes a max reduction along the specified axes.
Parameters
Name | Description |
---|---|
op | The input to the reduction. |
axes | The axes the reduction should be performed along. |
Returns
The resulting operation.
Example
import dopt .core : evaluate;
auto a = float32([2, 2],[
1.0f, 4.0f,
3.0f, 6.0f
]);
assert(a .maxElement .evaluate() .as!float == [6.0f]); //Max value in the entire tensor
assert(a .maxElement([0]) .evaluate() .as!float == [3.0f, 6.0f]); //Max of each column
assert(a .maxElement([1]) .evaluate() .as!float == [4.0f, 6.0f]); //Max of each row