टेंसरफ़्लो :: ऑप्स :: 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
समान रैंक है। - सेगमेंट_िड्स: ए-डी टेंसर। मानों को क्रमबद्ध किया जाना चाहिए और दोहराया जा सकता है।
- num_seaction: अलग-अलग सेगमेंट आईडी की संख्या के बराबर होना चाहिए।
रिटर्न:
-
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