@Namespace(value="tensorflow::ops") @NoOffset @Properties(inherit=tensorflow.class) public class UniqueWithCounts extends Pointer
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 value of x
in the unique output y
. Finally, it returns a third tensor count
that
contains the count of each element of y
in x
. In other words:
y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]
For example:
# tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
y, idx, count = unique_with_counts(x)
y ==> [1, 2, 4, 7, 8]
idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
count ==> [2, 1, 3, 1, 2]
Arguments:
* scope: A Scope object
* x: 1-D.
Returns:
* Output
y: 1-D.
* Output
idx: 1-D.
* Output
count: 1-D.Modifier and Type | Class and Description |
---|---|
static class |
UniqueWithCounts.Attrs
Optional attribute setters for UniqueWithCounts
|
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
UniqueWithCounts(Pointer p)
Pointer cast constructor.
|
UniqueWithCounts(Scope scope,
Input x) |
UniqueWithCounts(Scope scope,
Input x,
UniqueWithCounts.Attrs attrs) |
Modifier and Type | Method and Description |
---|---|
Output |
count() |
UniqueWithCounts |
count(Output setter) |
Output |
idx() |
UniqueWithCounts |
idx(Output setter) |
Operation |
operation() |
UniqueWithCounts |
operation(Operation setter) |
static UniqueWithCounts.Attrs |
OutIdx(int x) |
Output |
y() |
UniqueWithCounts |
y(Output setter) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public UniqueWithCounts(Pointer p)
Pointer(Pointer)
.@ByVal public static UniqueWithCounts.Attrs OutIdx(@Cast(value="tensorflow::DataType") int x)
public UniqueWithCounts operation(Operation setter)
public UniqueWithCounts y(Output setter)
public UniqueWithCounts idx(Output setter)
public UniqueWithCounts count(Output setter)
Copyright © 2022. All rights reserved.