tensorflow :: ops :: SparseSegmentSum
#include <math_ops.h>
Toplamı bir tensörün seyrek bölümleri boyunca hesaplar.
Özet
Segmentlerin açıklaması için segmentasyon bölümünü okuyun.
SegmentSum
, ancak segment_ids
, indices
belirtilen 0 boyutunun bir alt kümesini seçerek data
ilk boyutundan daha düşük bir sıralamaya sahip olabilir.
Örneğin:
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]))
Argümanlar:
- kapsam: Bir Scope nesnesi
- indisler: 1-D tensör. Aynı rütbe Has
segment_ids
. - segment_ids: 1-D tensör. Değerler sıralanmalı ve tekrarlanabilir.
İadeler:
-
Output
: Segment sayısı olank
boyutuna sahip 0 boyutu dışında verilerle aynı şekle sahiptir.
Yapıcılar ve Yıkıcılar | |
---|---|
SparseSegmentSum (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input indices, :: tensorflow::Input segment_ids) |
Genel özellikler | |
---|---|
operation | |
output |
Kamusal işlevler | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Genel özellikler
operasyon
Operation operation
çıktı
::tensorflow::Output output
Kamusal işlevler
SparseSegmentSum
SparseSegmentSum( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input indices, ::tensorflow::Input segment_ids )
düğüm
::tensorflow::Node * node() const
operator :: tensorflow :: Girdi
operator::tensorflow::Input() const
operator :: tensorflow :: Çıktı
operator::tensorflow::Output() const