tensorflow:: عملیات:: SparseSegmentSumWithNumSegments

#include <math_ops.h>

مجموع را در امتداد بخش‌های پراکنده یک تانسور محاسبه می‌کند.

خلاصه

مانند SparseSegmentSum ، اما id های ناموجود در segment_ids را نیز می‌پذیرد. اگر id ناموجود باشد، تانسور 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]]

استدلال‌ها:

  • دامنه: یک شیء دامنه
  • شاخص‌ها: یک تانسور تک‌بعدی. رتبه‌ای مشابه segment_ids دارد.
  • segment_ids: یک تانسور یک بعدی. مقادیر باید مرتب شده باشند و می‌توانند تکرار شوند.
  • num_segments: باید برابر با تعداد شناسه‌های (ID) بخش‌های مجزا باشد.

بازده:

  • Output : شکلی مشابه داده‌ها دارد، به جز بُعد ۰ که اندازه آن 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