tensorflow::ops::GatherV2

#include <array_ops.h>

Соберите срезы с axis params в соответствии с 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]

Обратите внимание, что на ЦП, если обнаруживается выход за пределы допустимого индекса, возвращается ошибка. На графическом процессоре, если обнаруживается выход за пределы допустимого индекса, в соответствующее выходное значение помещается 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

выход

::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
)

узел

::tensorflow::Node * node() const 

оператор::tensorflow::Input

 operator::tensorflow::Input() const 

оператор::tensorflow::Output

 operator::tensorflow::Output() const 

Открытые статические функции

BatchDims

Attrs BatchDims(
  int64 x
)