Tensorflow :: ops :: Cumsum
#include <math_ops.h>
Berechnen Sie die kumulative Summe des Tensors x
entlang der axis
.
Zusammenfassung
Standardmäßig führt diese Operation eine inklusive Cumsum aus, was bedeutet, dass das erste Element der Eingabe mit dem ersten Element der Ausgabe identisch ist:
tf.cumsum([a, b, c]) # => [a, a + b, a + b + c]
Durch Setzen des exclusive
kwarg auf True
wird stattdessen ein exklusiver Cumsum ausgeführt:
tf.cumsum([a, b, c], exclusive=True) # => [0, a, a + b]
Wenn Sie den reverse
kwarg auf True
, wird der Cumsum in die entgegengesetzte Richtung ausgeführt:
tf.cumsum([a, b, c], reverse=True) # => [a + b + c, b + c, c]
Dies ist effizienter als die Verwendung separater tf.reverse
.
Das reverse
und das exclusive
Warwar können auch kombiniert werden:
tf.cumsum([a, b, c], exclusive=True, reverse=True) # => [b + c, c, 0]
Argumente:
- scope: Ein Scope- Objekt
- x: Ein
Tensor
. Muss einer der folgenden Typen sein:float32
,float64
,int64
,int32
,uint8
,uint16
,int16
,int8
,complex64
,complex128
,qint8
,quint8
,qint32
,half
. - Achse: Ein
Tensor
vom Typint32
(Standard: 0). Muss im Bereich[-rank(x), rank(x))
.
Optionale Attribute (siehe Attrs
):
- exklusiv: Wenn
True
, führen Sie einen exklusiven Cumsum durch. - reverse: Ein
bool
(Standard: False).
Kehrt zurück:
-
Output
: Der Out-Tensor.
Konstruktoren und Destruktoren | |
---|---|
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) |
Öffentliche Attribute | |
---|---|
operation | |
out |
Öffentliche Funktionen | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Öffentliche statische Funktionen | |
---|---|
Exclusive (bool x) | |
Reverse (bool x) |
Strukturen | |
---|---|
tensorflow :: ops :: Cumsum :: Attrs | Optionale Attributsetzer fürCumsum . |
Öffentliche Attribute
Operation
Operation operation
aus
::tensorflow::Output out
Öffentliche Funktionen
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 )
Knoten
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Output
operator::tensorflow::Output() const
Öffentliche statische Funktionen
Exklusiv
Attrs Exclusive( bool x )
Umkehren
Attrs Reverse( bool x )