tensorflow:: אופס:: 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: אובייקט Scope
  • מדדים: טנזור 1-D. בעל דירוג זהה לזה של segment_ids .
  • segment_ids: טנזור 1-D. יש למיין את הערכים וניתן לחזור עליהם.
  • num_segments: צריך להיות שווה למספר מזהי הפלחים הנבדלים.

החזרות:

  • 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 

מפעיל::tensorflow::קלט

 operator::tensorflow::Input() const 

אופרטור::tensorflow::פלט

 operator::tensorflow::Output() const