Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
тензорный поток:: опс:: NthЭлемент
#include <nn_ops.h>
Находит значения статистики n
-го порядка для последнего измерения.
Краткое содержание
Если входные данные являются вектором (ранг-1), находит записи, которые являются наименьшим n-ным значением в векторе, и выводит их значения в виде скалярного тензора.
Для матриц (соответственно входные данные более высокого ранга) вычисляет элементы, которые представляют собой n-ное наименьшее значение в каждой строке (соответственно вектор по последнему измерению). Таким образом,
values.shape = input.shape[:-1]
Аргументы:
- область: объект области.
- ввод: 1-D или выше с последним измерением не менее
n+1
. - н: 0-Д. Позиция отсортированного вектора для выбора по последнему измерению (вдоль каждой строки для матриц). Допустимый диапазон n:
[0, input.shape[:-1])
Необязательные атрибуты (см. Attrs
):
- Обратное: если установлено значение True, найти n-ное наибольшее значение в векторе и наоборот.
Возврат:
-
Output
: статистика n
-го порядка по каждому последнему размерному срезу.
Публичные статические функции |
---|
Reverse (bool x) | |
Публичные атрибуты
Общественные функции
узел
::tensorflow::Node * node() const
operator::tensorflow::Input() const
оператор::tensorflow::Выход
operator::tensorflow::Output() const
Публичные статические функции
Обеспечить регресс
Attrs Reverse(
bool x
)
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-26 UTC.
[null,null,["Последнее обновление: 2025-07-26 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\nArguments:\n\n- scope: A [Scope](/versions/r1.15/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/r1.15/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/r1.15/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/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r1.15/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/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` n, const `[NthElement::Attrs](/versions/r1.15/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/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [values](#classtensorflow_1_1ops_1_1_nth_element_1a2b48d7270f25613807700819eff1cb49) | `::`[tensorflow::Output](/versions/r1.15/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/r1.15/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/r1.15/api_docs/cc/struct/tensorflow/ops/nth-element/attrs) | Optional attribute setters for [NthElement](/versions/r1.15/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```"]]