זרימת טנסור :: אופ :: SparseSegmentSumWithNumSegments
#include <math_ops.h>
מחשבת את הסכום לאורך קטעים דלילים של טנזור.
סיכום
כמו SparseSegmentSum
, אך מאפשר מזהים חסרים ב- segment_ids
. אם מזהה מוטעה לא נכון, טנזור output
במצב זה אופס.
קרא את החלק על פילוח להסבר על פלחים.
לדוגמה:
c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
tf.sparse_segment_sum_with_num_segments( c, tf.constant([0, 1]), tf.constant([0, 0]), num_segments=3) # => [[0 0 0 0] # [0 0 0 0] # [0 0 0 0]]
tf.sparse_segment_sum_with_num_segments(c, tf.constant([0, 1]), tf.constant([0, 2], num_segments=4)) # => [[ 1 2 3 4] # [ 0 0 0 0] # [-1 -2 -3 -4] # [ 0 0 0 0]]
טענות:
- היקף: אובייקט Scope
- מדדים: טנסור 1-D. דירוג זהה לזה של
segment_ids
- segment_ids: טנסור 1-D. יש למיין את הערכים וניתן לחזור עליהם.
- מספר_סגמנטים: צריך להיות שווה למספר מזהי הפלחים המובהקים.
החזרות:
-
Output
: יש צורה זהה לנתונים, למעט ממד 0 שיש לו מספרnum_segments
.
קונסטרוקטורים ומשחתנים | |
---|---|
SparseSegmentSumWithNumSegments (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input indices, :: tensorflow::Input segment_ids, :: tensorflow::Input num_segments) |
תכונות ציבוריות | |
---|---|
operation | |
output |
פונקציות ציבוריות | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
תכונות ציבוריות
מבצע
Operation operation
תְפוּקָה
::tensorflow::Output output
פונקציות ציבוריות
SparseSegmentSumWithNumSegments
SparseSegmentSumWithNumSegments( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input indices, ::tensorflow::Input segment_ids, ::tensorflow::Input num_segments )
צוֹמֶת
::tensorflow::Node * node() const
אופרטור :: זורם tensor :: קלט
operator::tensorflow::Input() const
אופרטור :: זרימת טנסור :: פלט
operator::tensorflow::Output() const
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2020-04-20 (שעון UTC).
[]
[]