tensorflow::ops::Cumsum
#include <math_ops.h> Hitung jumlah kumulatif tensor x sepanjang axis .
Ringkasan
Secara default, operasi ini melakukan penjumlahan kumulatif inklusif, yang berarti bahwa elemen pertama dari input identik dengan elemen pertama dari output:
tf.cumsum([a, b, c]) # => [a, a + b, a + b + c]
Dengan mengatur kata kunci exclusive menjadi True , maka akan dilakukan penjumlahan dan penjumlahan eksklusif:
tf.cumsum([a, b, c], exclusive=True) # => [0, a, a + b]
Dengan mengatur kwarg reverse menjadi True , maka penjumlahan kumulatif dilakukan ke arah yang berlawanan:
tf.cumsum([a, b, c], reverse=True) # => [a + b + c, b + c, c]
Ini lebih efisien daripada menggunakan operasi tf.reverse terpisah.
Kata kunci reverse dan exclusive juga dapat dikombinasikan:
tf.cumsum([a, b, c], exclusive=True, reverse=True) # => [b + c, c, 0]
Argumen:
- Cakupan: Objek Cakupan
- x: Sebuah
Tensor. Harus berupa salah satu tipe berikut:float32,float64,int64,int32,uint8,uint16,int16,int8,complex64,complex128,qint8,quint8,qint32,half. - axis:
Tensorbertipeint32(default: 0). Harus berada dalam rentang[-rank(x), rank(x)).
Atribut opsional (lihat Attrs ):
- eksklusif: Jika
True, lakukan cumsum eksklusif. - reverse: Sebuah
bool(nilai default: False).
Mengembalikan:
-
Output: Tensor keluaran.
Konstruktor dan Destruktor | |
|---|---|
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) |
Atribut publik | |
|---|---|
operation | |
out | |
Fungsi publik | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
Fungsi statis publik | |
|---|---|
Exclusive (bool x) | |
Reverse (bool x) | |
Struktur | |
|---|---|
| tensorflow::ops::Cumsum::Attrs | Pengaturan atribut opsional untuk Cumsum . |
Atribut publik
operasi
Operation operation
keluar
::tensorflow::Output out
Fungsi publik
Jumlah kumulatif
Cumsum( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input axis )
Jumlah kumulatif
Cumsum( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input axis, const Cumsum::Attrs & attrs )
simpul
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Fungsi statis publik
Eksklusif
Attrs Exclusive( bool x )
Balik
Attrs Reverse( bool x )