tensorflow::ops::GatherV2
#include <array_ops.h>
Gather срезы из params по оси axis в соответствии с indices.
Краткое описание
indices должен быть целочисленным тензором любой размерности (обычно 0-й или 1-й). Создаёт выходной тензор с формой params.shape[:axis] + indices.shape + params.shape[axis + 1:], где:
# Scalar indices (output is rank(params) - 1). output[a_0, ..., a_n, b_0, ..., b_n] = params[a_0, ..., a_n, indices, b_0, ..., b_n]
# Vector indices (output is rank(params)). output[a_0, ..., a_n, i, b_0, ..., b_n] = params[a_0, ..., a_n, indices[i], b_0, ..., b_n]
# Higher rank indices (output is rank(params) + rank(indices) - 1). output[a_0, ..., a_n, i, ..., j, b_0, ... b_n] = params[a_0, ..., a_n, indices[i, ..., j], b_0, ..., b_n]
Обратите внимание, что на CPU, если найден индекс за пределами границ, возвращается ошибка. На GPU, если найден индекс за пределами границ, в соответствующее значение выходного тензора записывается 0.
См. также tf.batch_gather и tf.gather_nd.
Аргументы:
- scope: Объект Scope
- params: Тензор, из которого нужно извлечь значения. Должен иметь размерность не менее
axis + 1. - indices: Индексный тензор. Должен быть в диапазоне
[0, params.shape[axis]). - axis: Ось в
paramsдля извлеченияindices. По умолчанию первая ось. Поддерживает отрицательные индексы.
Возвращает:
-
Output: Значения изparams, извлечённые по индексам, заданнымindices, с формойparams.shape[:axis] + indices.shape + params.shape[axis + 1:].
| Конструкторы и деструкторы | |
|---|---|
GatherV2(const ::tensorflow::Scope & scope, ::tensorflow::Input params, ::tensorflow::Input indices, ::tensorflow::Input axis) | |
GatherV2(const ::tensorflow::Scope & scope, ::tensorflow::Input params, ::tensorflow::Input indices, ::tensorflow::Input axis, const GatherV2::Attrs & attrs) |
| Публичные атрибуты | |
|---|---|
operation | |
output | |
| Публичные функции | |
|---|---|
node() const | ::tensorflow::Node * |
operator::tensorflow::Input() const | |
operator::tensorflow::Output() const | |
| Публичные статические функции | |
|---|---|
BatchDims(int64 x) | |
| Структуры | |
|---|---|
| tensorflow::ops::GatherV2::Attrs | Дополнительные атрибуты для установки для GatherV2. |
Публичные атрибуты
operation
Operation operation
output
::tensorflow::Output output
Публичные функции
GatherV2
GatherV2( const ::tensorflow::Scope & scope, ::tensorflow::Input params, ::tensorflow::Input indices, ::tensorflow::Input axis )
GatherV2
GatherV2( const ::tensorflow::Scope & scope, ::tensorflow::Input params, ::tensorflow::Input indices, ::tensorflow::Input axis, const GatherV2::Attrs & attrs )
node
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Публичные статические функции
BatchDims
Attrs BatchDims( int64 x )
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/gather-v2