tensorflow::ops::SparseSegmentSumWithNumSegments

#include <math_ops.h>

Calcola la somma lungo i segmenti sparsi di un tensore.

Riepilogo

Simile a SparseSegmentSum , ma consente la presenza di ID mancanti in segment_ids . Se un ID è mancante, il tensore output in quella posizione verrà azzerato.

Per una spiegazione sui segmenti, consultare la sezione relativa alla segmentazione .

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]]

Argomentazioni:

  • ambito: un oggetto Scope
  • indici: Un tensore 1D. Ha lo stesso rango di segment_ids .
  • segment_ids: Un tensore 1D. I valori devono essere ordinati e possono essere ripetuti.
  • num_segments: Deve corrispondere al numero di ID di segmento distinti.

Resi:

  • Output : Ha la stessa forma dei dati, eccetto per la dimensione 0 che ha dimensione num_segments .

Costruttori e distruttori

SparseSegmentSumWithNumSegments (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input indices, :: tensorflow::Input segment_ids, :: tensorflow::Input num_segments)

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 dei segmenti sparsi con numero di segmenti

 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::tensoreflusso::output

 operator::tensorflow::Output() const