T - data type for values() output@Operator(group="nn") public final class NthElement<T extends java.lang.Number> extends PrimitiveOp implements Operand<T>
If the input is a vector (rank-1), finds the entries which is the nth-smallest value in the vector and outputs their values as scalar tensor.
For matrices (resp. higher rank input), computes the entries which is the nth-smallest value in each row (resp. vector along the last dimension). Thus,
values.shape = input.shape[:-1]
| Modifier and Type | Class | Description |
|---|---|---|
static class |
NthElement.Options |
Optional attributes for
NthElement |
operation| Modifier and Type | Method | Description |
|---|---|---|
Output<T> |
asOutput() |
Returns the symbolic handle of a tensor.
|
static <T extends java.lang.Number> |
create(Scope scope,
Operand<T> input,
Operand<java.lang.Integer> n,
NthElement.Options... options) |
Factory method to create a class to wrap a new NthElement operation to the graph.
|
static NthElement.Options |
reverse(java.lang.Boolean reverse) |
|
Output<T> |
values() |
The `n`-th order statistic along each last dimensional slice.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitequals, hashCode, toStringpublic static <T extends java.lang.Number> NthElement<T> create(Scope scope, Operand<T> input, Operand<java.lang.Integer> n, NthElement.Options... options)
scope - current graph scopeinput - 1-D or higher with last dimension at least `n+1`.n - 0-D. Position of sorted vector to select along the last dimension (along
each row for matrices). Valid range of n is `[0, input.shape[:-1])`options - carries optional attributes valuespublic static NthElement.Options reverse(java.lang.Boolean reverse)
reverse - When set to True, find the nth-largest value in the vector and vice
versa.public Output<T> asOutput()
OperandInputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.
asOutput in interface Operand<T extends java.lang.Number>OperationBuilder.addInput(Output)