TopKUnique

public final class TopKUnique

Returns the TopK unique values in the array in sorted order. The

running time is proportional to the product of K and the input size. Sorting the whole array is more efficient for sufficiently large values of K. The median-of-medians algorithm is probably faster, but difficult to implement efficiently in XLA. If there are fewer than K unique numbers (not NANs), the results are padded with negative infinity. NaNs are never returned. Subnormal numbers are flushed to zero. If an element appears at multiple indices, the highest index is returned. If a TopK element never appears in the input due to padding values, the indices are padded with negative one. If a padding value appears in the input and padding is needed, the highest index of the padding value will be returned. The semantics are not the same as kth_order_statistic.

Constants

String OP_NAME The name of this op, as known by TensorFlow core engine

Public Methods

static TopKUnique
create(Scope scope, Operand<TFloat32> input, Long k)
Factory method to create a class wrapping a new TopKUnique operation.
Output<TFloat32>
topk()
Output<TInt32>

Inherited Methods

Constants

public static final String OP_NAME

The name of this op, as known by TensorFlow core engine

Constant Value: "TopKUnique"

Public Methods

public static TopKUnique create (Scope scope, Operand<TFloat32> input, Long k)

Factory method to create a class wrapping a new TopKUnique operation.

Parameters
scope current scope
Returns
  • a new instance of TopKUnique

public Output<TFloat32> topk ()

public Output<TInt32> topkIndices ()