tensorflow:: ops:: SparseSegmentSum
#include <math_ops.h>テンソルの疎なセグメントに沿った合計を計算します。
まとめ
セグメントの説明については、セグメンテーションに関するセクションをお読みください。
SegmentSumと同様ですが、 segment_ids dataの最初の次元よりも低いランクを持つことができ、 indicesで指定された次元 0 のサブセットを選択します。
例えば:
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]))
議論:
- スコープ:スコープオブジェクト
- indices: 1次元テンソル。segment_ids
segment_ids同じランクを持ちます。 - segment_ids: 1次元テンソル。値はソートされている必要があり、重複しても構いません。
返品:
-
Output:次元0を除いてデータと同じ形状で、次元0のサイズはセグメント数kです。
コンストラクターとデストラクタ | |
|---|---|
SparseSegmentSum (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input indices, :: tensorflow::Input segment_ids) |
公開属性 | |
|---|---|
operation | |
output | |
公的機能 | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
公開属性
手術
Operation operation
出力
::tensorflow::Output output
公的機能
スパースセグメントの合計
SparseSegmentSum( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input indices, ::tensorflow::Input segment_ids )
ノード
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const