tensorflow::ops::GatherV2
#include <array_ops.h> Kumpulkan irisan dari axis params sesuai dengan indices .
Ringkasan
indices harus berupa tensor bilangan bulat dengan dimensi apa pun (biasanya 0-D atau 1-D). Menghasilkan tensor keluaran dengan bentuk params.shape[:axis] + indices.shape[batch_dims:] + params.shape[axis + 1:] di mana:
# 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]
Perlu dicatat bahwa pada CPU, jika indeks di luar batas ditemukan, akan dikembalikan sebuah error. Pada GPU, jika indeks di luar batas ditemukan, nilai 0 akan disimpan dalam nilai output yang sesuai.
Lihat juga tf.batch_gather dan tf.gather_nd .
Argumen:
- Cakupan: Objek Cakupan
- params: Tensor tempat nilai-nilai akan diambil. Harus memiliki rank minimal
axis + 1. - indeks: Tensor indeks. Harus berada dalam rentang
[0, params.shape[axis]). - axis: Sumbu dalam
paramsyang akan digunakan untuk mengumpulkanindices. Secara default menggunakan dimensi pertama. Mendukung indeks negatif.
Mengembalikan:
-
Output: Nilai dariparamsyang dikumpulkan dari indeks yang diberikan olehindices, dengan bentukparams.shape[:axis] + indices.shape + params.shape[axis + 1:].
Konstruktor dan Destruktor | |
|---|---|
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) |
Atribut publik | |
|---|---|
operation | |
output | |
Fungsi publik | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
Fungsi statis publik | |
|---|---|
BatchDims (int64 x) | |
Struktur | |
|---|---|
| tensorflow::ops::GatherV2::Attrs | Pengaturan atribut opsional untuk GatherV2 . |
Atribut publik
operasi
Operation operation
keluaran
::tensorflow::Output output
Fungsi publik
Kumpulkan V2
GatherV2( const ::tensorflow::Scope & scope, ::tensorflow::Input params, ::tensorflow::Input indices, ::tensorflow::Input axis )
Kumpulkan V2
GatherV2( const ::tensorflow::Scope & scope, ::tensorflow::Input params, ::tensorflow::Input indices, ::tensorflow::Input axis, const GatherV2::Attrs & attrs )
simpul
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Fungsi statis publik
BatchDims
Attrs BatchDims( int64 x )