tensorflow:: אופס:: GatherV2
#include <array_ops.h>
אסוף פרוסות מציר axis
params
לפי indices
.
תַקצִיר
indices
חייבים להיות טנסור שלם של כל מימד (בדרך כלל 0-D או 1-D). מייצר טנזור פלט עם הצורה params.shape[:axis] + indices.shape + params.shape[axis + 1:]
כאשר:
# 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]

שימו לב שב-CPU, אם נמצא אינדקס מחוץ לתחום, מוחזרת שגיאה. ב-GPU, אם נמצא אינדקס מחוץ לתחום, 0 מאוחסן בערך הפלט המתאים.
ראה גם tf.batch_gather
ו- tf.gather_nd
.
טיעונים:
- scope: אובייקט Scope
- params: הטנזור שממנו לאסוף ערכים. חייב להיות לפחות
axis + 1
. - מדדים: טנסור אינדקס. חייב להיות בטווח
[0, params.shape[axis])
. - ציר: הציר
params
שממנו יש לאסוףindices
. ברירת המחדל למימד הראשון. תומך באינדקסים שליליים.
החזרות:
-
Output
: ערכיםparams
שנאספו ממדדים שניתנו על ידיindices
, עם צורהparams.shape[:axis] + indices.shape + params.shape[axis + 1:]
.
בנאים והורסים | |
---|---|
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) |
תפקידים ציבוריים | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
מבנים | |
---|---|
tensorflow:: ops:: GatherV2:: Attrs | קובעי תכונות אופציונליים עבור GatherV2 . |
תכונות ציבוריות
מִבצָע
Operation operation
תְפוּקָה
::tensorflow::Output output
תפקידים ציבוריים
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 )
צוֹמֶת
::tensorflow::Node * node() const
מפעיל::tensorflow::קלט
operator::tensorflow::Input() const
אופרטור::tensorflow::פלט
operator::tensorflow::Output() const
פונקציות סטטיות ציבוריות
BatchDims
Attrs BatchDims( int64 x )