T
- data type for values()
output@Operator(group="nn") public final class NthElement<T extends 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 and Description |
---|---|
static class |
NthElement.Options
Optional attributes for
NthElement |
operation
Modifier and Type | Method and Description |
---|---|
Output<T> |
asOutput()
Returns the symbolic handle of a tensor.
|
static <T extends Number> |
create(Scope scope,
Operand<T> input,
Operand<Integer> n,
NthElement.Options... options)
Factory method to create a class wrapping a new NthElement operation.
|
static NthElement.Options |
reverse(Boolean reverse) |
Output<T> |
values()
The `n`-th order statistic along each last dimensional slice.
|
equals, hashCode, op, toString
public static <T extends Number> NthElement<T> create(Scope scope, Operand<T> input, Operand<Integer> n, NthElement.Options... options)
scope
- current 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(Boolean reverse)
reverse
- When set to True, find the nth-largest value in the vector and vice
versa.public Output<T> asOutput()
Operand
Inputs 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 Number>
OperationBuilder.addInput(Output)
Copyright © 2022. All rights reserved.