Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::NthElement
#include <nn_ops.h>
Finds values of the n
-th order statistic for the last dimension.
Summary
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]
Args:
- scope: A Scope object
- input: 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])
Optional attributes (see Attrs
):
- reverse: When set to True, find the nth-largest value in the vector and vice versa.
Returns:
Output
: The n
-th order statistic along each last dimensional slice.
Public static functions
|
Reverse(bool x)
|
|
Public attributes
Public functions
node
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Public static functions
Reverse
Attrs Reverse(
bool x
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tensorflow::ops::NthElement Class Reference\n\ntensorflow::ops::NthElement\n===========================\n\n`#include \u003cnn_ops.h\u003e`\n\nFinds values of the `n`-th order statistic for the last dimension.\n\nSummary\n-------\n\nIf 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.\n\nFor matrices (resp. higher rank input), computes the entries which is the nth-smallest value in each row (resp. vector along the last dimension). Thus, \n\n```cplint\nvalues.shape = input.shape[:-1]\n```\n\n\u003cbr /\u003e\n\nArgs:\n\n- scope: A [Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: 1-D or higher with last dimension at least `n+1`.\n- 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])`\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/nth-element/attrs#structtensorflow_1_1ops_1_1_nth_element_1_1_attrs)):\n\n- reverse: When set to True, find the nth-largest value in the vector and vice versa.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The `n`-th order statistic along each last dimensional slice.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [NthElement](#classtensorflow_1_1ops_1_1_nth_element_1ad57d32106099de0a7c5cd0e118f56250)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` n)` ||\n| [NthElement](#classtensorflow_1_1ops_1_1_nth_element_1a2c84dbdc0bb358d13e010718142e8462)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` n, const `[NthElement::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/nth-element/attrs#structtensorflow_1_1ops_1_1_nth_element_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_nth_element_1a41b2c3dfd7a0fa9341473a14fab18494) | [Operation](/versions/r2.14/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [values](#classtensorflow_1_1ops_1_1_nth_element_1a2b48d7270f25613807700819eff1cb49) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_nth_element_1a3f9b0440c04a7d951228451e291f008b)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_nth_element_1a9c60d391af60a8d7c268aacbf8a7093b)`() const ` | |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_nth_element_1ab7ba43882ec3623ce6d7c9bd9e2b47ba)`() const ` | |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|\n| [Reverse](#classtensorflow_1_1ops_1_1_nth_element_1ad86f92398afd7420e3f6db7643954291)`(bool x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/nth-element/attrs#structtensorflow_1_1ops_1_1_nth_element_1_1_attrs) |\n\n| ### Structs ||\n|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::NthElement::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/nth-element/attrs) | Optional attribute setters for [NthElement](/versions/r2.14/api_docs/cc/class/tensorflow/ops/nth-element#classtensorflow_1_1ops_1_1_nth_element). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### values\n\n```text\n::tensorflow::Output values\n``` \n\nPublic functions\n----------------\n\n### NthElement\n\n```gdscript\n NthElement(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input n\n)\n``` \n\n### NthElement\n\n```gdscript\n NthElement(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input n,\n const NthElement::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### Reverse\n\n```text\nAttrs Reverse(\n bool x\n)\n```"]]