przepływ tensorowy:: ops:: Zbierz V2

#include <array_ops.h>

Zbierz wycinki z axis osi params zgodnie z indices .

Streszczenie

indices muszą być tensorami całkowitymi o dowolnym wymiarze (zwykle 0-D lub 1-D). Tworzy tensor wyjściowy o kształcie params.shape[:axis] + indices.shape + params.shape[axis + 1:] gdzie:

    # 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]

Należy pamiętać, że na procesorze, jeśli zostanie znaleziony indeks spoza limitu, zwracany jest błąd. Na GPU, jeśli zostanie znaleziony indeks poza granicami, w odpowiedniej wartości wyjściowej zostanie zapisane 0.

Zobacz także tf.batch_gather i tf.gather_nd .

Argumenty:

  • zakres: Obiekt Scope
  • params: tensor, z którego mają być zbierane wartości. Musi mieć co najmniej axis + 1 .
  • indeksy: tensor indeksu. Musi należeć do zakresu [0, params.shape[axis]) .
  • oś: Oś w params , z której zbierane są indices . Domyślnie pierwszy wymiar. Obsługuje indeksy ujemne.

Zwroty:

  • Output : Wartości parametrów zebrane z params podanych przez indices , z kształtem params.shape[:axis] + indices.shape + params.shape[axis + 1:] .

Konstruktory i destruktory

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)

Atrybuty publiczne

operation
output

Funkcje publiczne

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

Publiczne funkcje statyczne

BatchDims (int64 x)

Struktury

tensorflow:: ops:: GatherV2:: Atrybuty

Opcjonalne moduły ustawiające atrybuty dla GatherV2 .

Atrybuty publiczne

operacja

Operation operation

wyjście

::tensorflow::Output output

Funkcje publiczne

Zbierz V2

 GatherV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input params,
  ::tensorflow::Input indices,
  ::tensorflow::Input axis
)

Zbierz V2

 GatherV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input params,
  ::tensorflow::Input indices,
  ::tensorflow::Input axis,
  const GatherV2::Attrs & attrs
)

węzeł

::tensorflow::Node * node() const 

operator::tensorflow::Wejście

 operator::tensorflow::Input() const 

operator::tensorflow::Wyjście

 operator::tensorflow::Output() const 

Publiczne funkcje statyczne

BatchDims

Attrs BatchDims(
  int64 x
)