tf.unique

tf.unique

tf.unique

unique(
    x,
    out_idx=None,
    name=None
)

Defined in tensorflow/python/ops/gen_array_ops.py.

See the guide: Math > Sequence Comparison and Indexing

Finds unique elements in a 1-D tensor.

This operation returns a tensor y containing all of the unique elements of x sorted in the same order that they occur in x. This operation also returns a tensor idx the same size as x that contains the index of each