tensorflow::ops::SegmentSum
#include <math_ops.h>Calcola la somma lungo i segmenti di un tensore.
Riepilogo
Per una spiegazione sui segmenti, consultare la sezione relativa alla segmentazione .
Calcola un tensore tale che \(output_i = data_j\) where sum is over j such that segment_ids[j] == i .
If the sum is empty for a given segment ID i , output[i] = 0 .

Per esempio:
c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) tf.segment_sum(c, tf.constant([0, 0, 1])) # ==> [[5, 5, 5, 5], # [5, 6, 7, 8]]
Argomentazioni:
- ambito: un oggetto Scope
- segment_ids: A 1-D tensor whose size is equal to the size of
data's first dimension. Values should be sorted and can be repeated.
Resi:
-
Output: Has same shape as data, except for dimension 0 which has sizek, the number of segments.
Costruttori e distruttori | |
|---|---|
SegmentSum (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input segment_ids) |
attributi pubblici | |
|---|---|
operation | |
output | |
Funzioni pubbliche | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
attributi pubblici
operazione
Operation operation
produzione
::tensorflow::Output output
Funzioni pubbliche
Somma del segmento
SegmentSum( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input segment_ids )
nodo
::tensorflow::Node * node() const
operatore::tensorflow::Input
operator::tensorflow::Input() const
operatore::tensoreflusso::output
operator::tensorflow::Output() const