tensoreflusso:: ops:: SparseSegmentSumWithNumSegments
#include <math_ops.h>
Calcola la somma lungo segmenti sparsi di un tensore.
Riepilogo
Come SparseSegmentSum
, ma consente ID mancanti in segment_ids
. Se manca un ID, il tensore output
in quella posizione verrà azzerato.
Leggi la sezione sulla segmentazione per una spiegazione dei segmenti.
Per esempio:
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]]
Argomenti:
- scope: un oggetto Scope
- indici: un tensore 1-D. Ha lo stesso rango di
segment_ids
. - segment_ids: un tensore 1-D. I valori devono essere ordinati e possono essere ripetuti.
- num_segments: deve essere uguale al numero di ID di segmento distinti.
Resi:
-
Output
: ha la stessa forma dei dati, ad eccezione della dimensione 0 che ha dimensionenum_segments
.
Costruttori e distruttori | |
---|---|
SparseSegmentSumWithNumSegments (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input indices, :: tensorflow::Input segment_ids, :: tensorflow::Input num_segments) |
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
SparseSegmentSumWithNumSegments
SparseSegmentSumWithNumSegments(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input indices,
::tensorflow::Input segment_ids,
::tensorflow::Input num_segments
)
nodo
::tensorflow::Node * node() const
operatore::tensorflow::Input
operator::tensorflow::Input() const
operatore::tensorflow::Output
operator::tensorflow::Output() const