@Namespace(value="tensorflow::ops") @NoOffset public static class tensorflow.TopK extends Pointer
k largest elements for the last dimension.
If the input is a vector (rank-1), finds the k largest entries in the vector
and outputs their values and indices as vectors. Thus values[j] is the
j-th largest entry in input, and its index is indices[j].
For matrices (resp. higher rank input), computes the top k entries in each
row (resp. vector along the last dimension). Thus,
values.shape = indices.shape = input.shape[:-1] + [k]
If two elements are equal, the lower-index element appears first.
Arguments:
* scope: A Scope object
* input: 1-D or higher with last dimension at least k.
* k: 0-D. Number of top elements to look for along the last dimension (along each
row for matrices).
Optional attributes (see Attrs):
* sorted: If true the resulting k elements will be sorted by the values in
descending order.
Returns:
* Output values: The k largest elements along each last dimensional slice.
* Output indices: The indices of values within the last dimension of input.| Modifier and Type | Class and Description |
|---|---|
static class |
tensorflow.TopK.Attrs
Optional attribute setters for TopK
|
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator| Constructor and Description |
|---|
TopK(Pointer p)
Pointer cast constructor.
|
TopK(tensorflow.Scope scope,
tensorflow.Input input,
tensorflow.Input k) |
TopK(tensorflow.Scope scope,
tensorflow.Input input,
tensorflow.Input k,
tensorflow.TopK.Attrs attrs) |
| Modifier and Type | Method and Description |
|---|---|
tensorflow.Output |
indices() |
tensorflow.TopK |
indices(tensorflow.Output indices) |
tensorflow.Operation |
operation() |
tensorflow.TopK |
operation(tensorflow.Operation operation) |
static tensorflow.TopK.Attrs |
Sorted(boolean x) |
tensorflow.Output |
values() |
tensorflow.TopK |
values(tensorflow.Output values) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, position, put, realloc, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zeropublic TopK(Pointer p)
Pointer.Pointer(Pointer).public TopK(@Const @ByRef tensorflow.Scope scope, @ByVal tensorflow.Input input, @ByVal tensorflow.Input k)
public TopK(@Const @ByRef tensorflow.Scope scope, @ByVal tensorflow.Input input, @ByVal tensorflow.Input k, @Const @ByRef tensorflow.TopK.Attrs attrs)
@ByVal public static tensorflow.TopK.Attrs Sorted(@Cast(value="bool") boolean x)
@ByRef public tensorflow.Operation operation()
public tensorflow.TopK operation(tensorflow.Operation operation)
@ByRef public tensorflow.Output values()
public tensorflow.TopK values(tensorflow.Output values)
@ByRef public tensorflow.Output indices()
public tensorflow.TopK indices(tensorflow.Output indices)
Copyright © 2019. All rights reserved.