tensorflow:: ops:: GatherV2

#include <array_ops.h>

Zbierz wycinki z axis params zgodnie z indices .

Streszczenie

indices muszą być tensorami całkowitymi o dowolnym wymiarze (zwykle 0-D lub 1-D). Generuje 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 w przypadku procesora CPU, jeśli zostanie znaleziony indeks poza zakresem, zwracany jest błąd. W przypadku procesora GPU, jeśli zostanie znaleziony indeks poza zakresem, w odpowiedniej wartości wyjściowej zapisywana jest wartość 0.

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

Argumenty:

  • zakres: obiekt zakresu
  • Params: Tensor, z którego pobierane są wartości. Musi wynosić co najmniej axis + 1 .
  • Indeksy: Tensor indeksu. Musi mieścić się w zakresie [0, params.shape[axis]) .
  • Oś: Oś w params , z której mają być pobierane indices . Domyślnie jest to pierwszy wymiar. Obsługuje indeksy ujemne.

Zwroty:

  • Output : Wartości params zebrane z indeksów podanych przez indices o kształcie 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:: Attrs

Opcjonalne settery atrybutów dla GatherV2 .

Atrybuty publiczne

działanie

Operation operation

wyjście

::tensorflow::Output output

Funkcje publiczne

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
)

węzeł

::tensorflow::Node * node() const 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const 

Publiczne funkcje statyczne

BatchDims

Attrs BatchDims(
  int64 x
)