Tensorflow :: ops :: GatherV2
#include <array_ops.h>
Sammelt Scheiben von params
Achse axis
entsprechend indices
.
Zusammenfassung
indices
müssen ein ganzzahliger Tensor einer beliebigen Dimension sein (normalerweise 0-D oder 1-D). Erzeugt einen Ausgabetensor mit params.shape[:axis] + indices.shape + params.shape[axis + 1:]
Form params.shape[:axis] + indices.shape + params.shape[axis + 1:]
Form params.shape[:axis] + indices.shape + params.shape[axis + 1:]
wobei:
# 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]
Beachten Sie, dass auf der CPU ein Fehler zurückgegeben wird, wenn ein nicht gebundener Index gefunden wird. Wenn auf der GPU ein Out-of-Bound-Index gefunden wird, wird eine 0 im entsprechenden Ausgabewert gespeichert.
Siehe auch tf.batch_gather
und tf.gather_nd
.
Argumente:
- scope: Ein Scope- Objekt
- params: Der Tensor, aus dem Werte gesammelt werden sollen. Muss mindestens
axis + 1
. - Indizes: Index-Tensor. Muss im Bereich
[0, params.shape[axis])
. - Achse: Die Achse in
params
, aus derindices
params
indices
. Standardmäßig wird die erste Dimension verwendet. Unterstützt negative Indizes.
Kehrt zurück:
-
Output
: Werte vonparams
die aus durch Indizes angegebenenindices
mit der Formparams.shape[:axis] + indices.shape + params.shape[axis + 1:]
.
Konstruktoren und Destruktoren | |
---|---|
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) |
Öffentliche Attribute | |
---|---|
operation | |
output |
Öffentliche Funktionen | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Öffentliche statische Funktionen | |
---|---|
BatchDims (int64 x) |
Strukturen | |
---|---|
tensorflow :: ops :: GatherV2 :: Attrs | Optionale Attributsetzer für GatherV2 . |
Öffentliche Attribute
Operation
Operation operation
Ausgabe
::tensorflow::Output output
Öffentliche Funktionen
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 )
Knoten
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Output
operator::tensorflow::Output() const
Öffentliche statische Funktionen
BatchDims
Attrs BatchDims( int64 x )