unique

Contents

unique#

Reduce to unique values in input. On completion a_out contains all unique values in a, and num_found contains the number of unique elements.

template<typename OpA>
__MATX_INLINE__ auto matx::unique(const OpA &a)#

Reduce to unique values

Reduces the input to only unique values saved into the output. Output tensor must be large enough to hold unique entries. To be safe, this can be the same size as the input, but if something is known about the data to indicate not as many entries are needed, the output can be smaller.

Template Parameters:

InputOperator – Input type

Parameters:

a – Input tensor

Returns:

Two operators, the first representing the unique items, and the second representing how many items were found

Examples#

(mtie(t1o, num_found) = unique(t1)).run(exec);