# 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.

<br />

### Public Methods

|---|---|
| static [TopKUnique](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/TopKUnique) | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/TopKUnique#create(org.tensorflow.op.Scope,%20org.tensorflow.Operand<java.lang.Float>,%20java.lang.Long))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Float\> input, Long k) Factory method to create a class wrapping a new TopKUnique operation. |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Float\> | [topk](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/TopKUnique#topk())() |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Integer\> | [topkIndices](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/TopKUnique#topkIndices())() |

### Inherited Methods

From class [org.tensorflow.op.PrimitiveOp](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp)

|---|---|
| final boolean | [equals](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#equals(java.lang.Object))(Object obj) |
| final int | [hashCode](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#hashCode())() |
| [Operation](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation) | [op](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#op())() Returns the underlying `https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation` |
| final String | [toString](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#toString())() |

From class java.lang.Object

|---|---|
| boolean | equals(Object arg0) |
| final Class\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| String | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Methods

#### public static [TopKUnique](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/TopKUnique)
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Float\> 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](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Float\>
**topk**
()

<br />

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Integer\>
**topkIndices**
()

<br />