tensorflow::ops::GatherV2
#include <array_ops.h> Rassemblez les tranches de l' axis des params en fonction indices .
Résumé
indices doivent être un tenseur d'entiers de dimension quelconque (généralement 0D ou 1D). Produit un tenseur de sortie de forme params.shape[:axis] + indices.shape + params.shape[axis + 1:] où :
# 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]
Notez que sur le processeur (CPU), si un index hors limites est détecté, une erreur est renvoyée. Sur le GPU, si un index hors limites est détecté, la valeur 0 est stockée dans la valeur de sortie correspondante.
Voir aussi tf.batch_gather et tf.gather_nd .
Arguments :
- portée : un objet Scope
- params : Le tenseur à partir duquel extraire les valeurs. Doit être au moins de rang
axis + 1. - indices : Tenseur d'indices. Doit être dans la plage
[0, params.shape[axis]). - axe : axe des
paramsà partir duquel extraireindices. Par défaut, il s’agit de la première dimension. Les indices négatifs sont pris en charge.
Retours :
-
Output: Valeurs deparamscollectées à partir des indices donnés parindices, avec la formeparams.shape[:axis] + indices.shape + params.shape[axis + 1:].
Constructeurs et destructeurs | |
|---|---|
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) |
attributs publics | |
|---|---|
operation | |
output | |
fonctions publiques | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
fonctions statiques publiques | |
|---|---|
BatchDims (int64 x) | |
Structures | |
|---|---|
| tensorflow::ops::GatherV2::Attrs | Définiteurs d'attributs optionnels pour GatherV2 . |
attributs publics
opération
Operation operation
sortir
::tensorflow::Output output
fonctions publiques
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 )
nœud
::tensorflow::Node * node() const
opérateur::tensorflow::Entrée
operator::tensorflow::Input() const
opérateur::tensorflow::Sortie
operator::tensorflow::Output() const
fonctions statiques publiques
Dimensions par lot
Attrs BatchDims( int64 x )