przepływ tensorowy:: ops:: Rzadka suma segmentów
#include <math_ops.h>Oblicza sumę wzdłuż rzadkich segmentów tensora.
Streszczenie
Przeczytaj sekcję dotyczącą segmentacji, aby uzyskać wyjaśnienie segmentów.
 Podobnie jak SegmentSum , ale segment_ids może mieć rangę mniejszą niż pierwszy wymiar data , wybierając podzbiór wymiaru 0, określony 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 tę samą rangę co segment_ids.
- segment_ids: Tensor 1-D. Wartości należy posortować i można je powtarzać.
Zwroty:
-  Output: ma taki sam kształt jak dane, z wyjątkiem wymiaru 0, który ma rozmiark, czyli liczbę segmentów.
| Konstruktory i destruktory | |
|---|---|
| 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
działanie
Operation operation
wyjście
::tensorflow::Output output
Funkcje publiczne
Rzadka suma segmentów
SparseSegmentSum( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input indices, ::tensorflow::Input segment_ids )
węzeł
::tensorflow::Node * node() const
operator::tensorflow::Wejście
operator::tensorflow::Input() const
operator::tensorflow::Wyjście
operator::tensorflow::Output() const