tensorflow::ops::Cumsum
#include <math_ops.h> Calcola la somma cumulativa del tensore x lungo axis .
Riepilogo
Per impostazione predefinita, questa operazione esegue una somma cumulativa inclusiva, il che significa che il primo elemento dell'input è identico al primo elemento dell'output:
tf.cumsum([a, b, c]) # => [a, a + b, a + b + c]
Impostando l'argomento exclusive su True , viene invece eseguita una somma cumulativa esclusiva:
tf.cumsum([a, b, c], exclusive=True) # => [0, a, a + b]
Impostando il parametro reverse su True , il calcolo della somma cumulativa viene eseguito nella direzione opposta:
tf.cumsum([a, b, c], reverse=True) # => [a + b + c, b + c, c]
Questo è più efficiente rispetto all'utilizzo di operazioni tf.reverse separate.
È possibile combinare anche gli argomenti reverse ed exclusive :
tf.cumsum([a, b, c], exclusive=True, reverse=True) # => [b + c, c, 0]
Argomentazioni:
- ambito: un oggetto Scope
- x: Un
Tensor. Deve essere uno dei seguenti tipi:float32,float64,int64,int32,uint8,uint16,int16,int8,complex64,complex128,qint8,quint8,qint32,half. - asse: un
Tensordi tipoint32(predefinito: 0). Deve essere nell'intervallo[-rank(x), rank(x)).
Attributi opzionali (vedere Attrs ):
- esclusivo: se
True, esegui cumsum esclusivo. - reverse: un
bool(predefinito: False).
Resi:
-
Output: Il tensore di output.
Costruttori e distruttori | |
|---|---|
Cumsum (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input axis) | |
Cumsum (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input axis, const Cumsum::Attrs & attrs) |
attributi pubblici | |
|---|---|
operation | |
out | |
Funzioni pubbliche | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
Funzioni statiche pubbliche | |
|---|---|
Exclusive (bool x) | |
Reverse (bool x) | |
Strutture | |
|---|---|
| tensorflow::ops::Cumsum::Attrs | Impostatori di attributi opzionali per Cumsum . |
attributi pubblici
operazione
Operation operation
fuori
::tensorflow::Output out
Funzioni pubbliche
Cumsum
Cumsum( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input axis )
Cumsum
Cumsum( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input axis, const Cumsum::Attrs & attrs )
nodo
::tensorflow::Node * node() const
operatore::tensorflow::Input
operator::tensorflow::Input() const
operatore::tensoreflusso::output
operator::tensorflow::Output() const
Funzioni statiche pubbliche
Esclusivo
Attrs Exclusive( bool x )
Inversione
Attrs Reverse( bool x )