tensorflow:: ops:: SegmentSum

#include <math_ops.h>

Computes the sum along segments of a tensor.

ملخص

اقرأ قسم التجزئة للحصول على شرح للقطاعات.

يحسب موترًا بحيث \(output_i = data_j\) where sum is over j such that segment_ids[j] == i .

If the sum is empty for a given segment ID 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 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const