Running maximum of array elements along a single axis along with
the index of the last occurrence of the running maximum.
At output position j, the values output is max(input[1:j]) and the
indices output is the largest i in 1:j with
input[i] == values[j] (last-occurrence tiebreak).
Arguments
- x
(
arrayish)
Arrayish value of any data type.- axis
(
integer(1))
Axis along which to accumulate. Negative values count from the end, i.e.-1refers to the last axis.
Value
list of two arrayish values:
The running maximum (same dtype as x) and the
running argmax (dtype i32, 1-based). Both have
the same shape as x.
StableHLO
Lowers to a variadic hlo_reduce_window() over (values, iota).