Check if all values along a given dimension are true, according to an array of keys.
Check if all values along a given dimension are true, according to an array of keys.
All values corresponding to each group of consecutive equal keys will be tested to make sure all are true. Keys can repeat; however, only consecutive key values will be considered for each reduction. If a key value is repeated somewhere else in the keys array it will be considered the start of a new reduction. There are two outputs: the reduced set of consecutive keys and the corresponding final set of reduced values.
An example demonstrating the reduction behavior can be seen in the following snippet.
The keys' input type must be integer (s32 or u32).
The output type is b8
.
The keys array must be 1-dimenstional matching the size of the reduced dimension. An example of multi-dimensional reduce-by-key can be seen below: