टेंसरफ़्लो:: ऑप्स:: SparseSegmentSumWithNumSegments

#include <math_ops.h>

एक टेंसर के विरल खंडों के साथ योग की गणना करता है।

सारांश

SparseSegmentSum की तरह, लेकिन segment_ids में गुम आईडी की अनुमति देता है। यदि कोई आईडी गायब है, तो उस स्थिति में 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]]

तर्क:

  • स्कोप: एक स्कोप ऑब्जेक्ट
  • सूचकांक: एक 1-डी टेंसर। segment_ids के समान रैंक है।
  • सेगमेंट_आईडी: एक 1-डी टेंसर। मानों को क्रमबद्ध किया जाना चाहिए और दोहराया जा सकता है।
  • num_segments: अलग-अलग सेगमेंट आईडी की संख्या के बराबर होनी चाहिए।

रिटर्न:

  • Output : इसका आकार डेटा के समान है, आयाम 0 को छोड़कर जिसका आकार 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 

ऑपरेटर::टेन्सरफ़्लो::इनपुट

 operator::tensorflow::Input() const 

ऑपरेटर::टेन्सरफ़्लो::आउटपुट

 operator::tensorflow::Output() const