tensorflow :: ops :: SparseSegmentSum
#include <math_ops.h>
Oblicza sumę wzdłuż nielicznych segmentów tensora.
streszczenie
Przeczytaj sekcję dotyczącą segmentacji, aby uzyskać wyjaśnienie dotyczące segmentów.
Jak SegmentSum
, ale segment_ids
może mieć rangę mniej niż data
pierwszego wymiaru „s, wybierając podzbiór wymiarze 0, określonego przez indices
.
Na przykład:
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]))
Argumenty:
- zakres: obiekt Scope
- indeksy: tensor 1-D. Ma taką samą pozycję jak
segment_ids
. - segment_ids: tensor 1-D. Wartości należy posortować i można je powtórzyć.
Zwroty:
-
Output
: ma taki sam kształt jak dane, z wyjątkiem wymiaru 0, który ma rozmiark
, liczbę segmentów.
Konstruktorzy i niszczyciele | |
---|---|
SparseSegmentSum (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input indices, :: tensorflow::Input segment_ids) |
Atrybuty publiczne | |
---|---|
operation | |
output |
Funkcje publiczne | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Atrybuty publiczne
operacja
Operation operation
wynik
::tensorflow::Output output
Funkcje publiczne
SparseSegmentSum
SparseSegmentSum( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input indices, ::tensorflow::Input segment_ids )
węzeł
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Output
operator::tensorflow::Output() const