tensorflow:: ops:: SegmentSum

#include <math_ops.h>

מחשב את הסכום לאורך מקטעים של טנזור.

תַקצִיר

קראו את הפרק על פילוח לקבלת הסבר על פלחים.

מחשב טנזור כך ש \(output_i = data_j\) כאשר sum חלק מ- j כך ש- segment_ids[j] == i .

אם הסכום ריק עבור מזהה מקטע נתון i , output[i] = 0 .

לְדוּגמָה:

c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]])
tf.segment_sum(c, tf.constant([0, 0, 1]))
# ==> [[5, 5, 5, 5],
#      [5, 6, 7, 8]]

טיעונים:

  • היקף: אובייקט היקף
  • segment_ids: טנזור חד-ממדי שגודלו שווה לגודל המימד הראשון של data . הערכים צריכים להיות ממוינים וניתן לחזור עליהם.

החזרות:

  • Output : בעל צורה זהה לנתונים, למעט ממד 0 שגודלו k , מספר הקטעים.

בנאים והורסים

SegmentSum (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input segment_ids)

מאפיינים ציבוריים

operation
output

תפקידים ציבוריים

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

מאפיינים ציבוריים

מִבצָע

Operation operation

תְפוּקָה

::tensorflow::Output output

תפקידים ציבוריים

סכום מקטעים

 SegmentSum(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input data,
  ::tensorflow::Input segment_ids
)

צוֹמֶת

::tensorflow::Node * node() const 

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

 operator::tensorflow::Input() const 

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

 operator::tensorflow::Output() const