tensorflow :: ops :: SparseSegmentSumWithNumSegments
#include <math_ops.h>
Toplamı bir tensörün seyrek bölümleri boyunca hesaplar.
Özet
SparseSegmentSum
, ancak segment_ids
eksik kimliklere izin verir. Bir id yanlışsa, o konumdaki output
tensörü sıfırlanacaktır.
Segmentlerin açıklaması için segmentasyon bölümünü okuyun.
Örneğin:
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]]
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.
- num_segments: Farklı segment kimliklerinin sayısına eşit olmalıdır.
İadeler:
-
Output
: boyutnum_segments
içeren boyut 0 dışında verilerle aynı şekle sahiptir.
Yapıcılar ve Yıkıcılar | |
---|---|
SparseSegmentSumWithNumSegments (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input indices, :: tensorflow::Input segment_ids, :: tensorflow::Input num_segments) |
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
SparseSegmentSumWithNumSegments
SparseSegmentSumWithNumSegments( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input indices, ::tensorflow::Input segment_ids, ::tensorflow::Input num_segments )
düğüm
::tensorflow::Node * node() const
operator :: tensorflow :: Girdi
operator::tensorflow::Input() const
operator :: tensorflow :: Çıktı
operator::tensorflow::Output() const