تدفق التوتر:: العمليات:: SparseSegmentSum

#include <math_ops.h>

يحسب المجموع على طول شرائح متفرقة من الموتر.

ملخص

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

مثل SegmentSum ، لكن من الممكن أن يكون تصنيف segment_ids أقل من ترتيب البعد الأول data ، مما يؤدي إلى تحديد مجموعة فرعية من البعد 0، يتم تحديدها بواسطة indices .

على سبيل المثال:

c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])

# Select two rows, one segment.
tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 0]))
# => [[0 0 0 0]]

# Select two rows, two segment.
tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 1]))
# => [[ 1  2  3  4]
#     [-1 -2 -3 -4]]

# Select all rows, two segments.
tf.sparse_segment_sum(c, tf.constant([0, 1, 2]), tf.constant([0, 0, 1]))
# => [[0 0 0 0]
#     [5 6 7 8]]

# Which is equivalent to:
tf.segment_sum(c, tf.constant([0, 0, 1]))

الحجج:

  • النطاق: كائن النطاق
  • المؤشرات: موتر 1-D. له نفس رتبة segment_ids .
  • section_ids: موتر ثنائي الأبعاد. يجب فرز القيم ويمكن تكرارها.

عائدات:

  • Output : له نفس شكل البيانات، باستثناء البعد 0 الذي يبلغ حجمه k ، وهو عدد المقاطع.

البنائين والمدمرين

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

الصفات العامة

operation
output

الوظائف العامة

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

الصفات العامة

عملية

Operation operation

انتاج

::tensorflow::Output output

الوظائف العامة

SparseSegmentSum

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

العقدة

::tensorflow::Node * node() const 

المشغل::tensorflow::الإدخال

 operator::tensorflow::Input() const 

المشغل::tensorflow::الإخراج

 operator::tensorflow::Output() const