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

#include <math_ops.h>

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

ملخص

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

يحسب موترًا بحيث يكون \(output[i] = {j...} data[j...]\) حيث يكون المجموع فوق صفوف j... بحيث يكون segment_ids[j...] == i . على عكس SegmentSum ، لا يلزم فرز segment_ids ولا يلزم تغطية جميع القيم في النطاق الكامل للقيم الصالحة.

إذا كان المجموع فارغًا لمعرف مقطع معين i ، output[i] = 0 . إذا كان i المقطع المحدد سالبًا، فسيتم إسقاط القيمة ولن تتم إضافتها إلى مجموع المقطع.

يجب أن يساوي num_segments عدد معرفات المقاطع المميزة.

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

الحجج:

  • النطاق: كائن النطاق
  • section_ids: موتر شكله هو بادئة data.shape .

عائدات:

  • Output : لها نفس شكل البيانات، باستثناء أبعاد segment_ids.rank الأولى، حيث يتم استبدالها ببُعد واحد بحجم num_segments .

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

UnsortedSegmentSum (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: 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

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

UnsortedSegmentSum

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

العقدة

::tensorflow::Node * node() const 

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

 operator::tensorflow::Input() const 

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

 operator::tensorflow::Output() const