tensör akışı:: işlem:: SparseSegmentSumWithNumSegments
#include <math_ops.h>
Bir tensörün seyrek bölümleri boyunca toplamı hesaplar.
Özet
SparseSegmentSum
benzer, ancak segment_ids
eksik kimliklere izin verir. Bir kimlik eksikse bu 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 Kapsam nesnesi
- endeksler: 1 boyutlu bir tensör.
segment_ids
ile aynı sıralamaya sahiptir. - segment_ids: 1 boyutlu bir tensör. Değerler sıralanmalı ve tekrarlanabilir olmalıdır.
- num_segments: Farklı segment kimliklerinin sayısına eşit olmalıdır.
İade:
-
Output
:num_segments
boyutuna sahip 0 boyutu 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) |
Kamu işlevleri | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Genel özellikler
operasyon
Operation operation
çıktı
::tensorflow::Output output
Kamu işlevleri
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
operatör::tensorflow::Giriş
operator::tensorflow::Input() const
operatör::tensorflow::Çıktı
operator::tensorflow::Output() const