aliran tensor:: operasi:: Cumprod
#include <math_ops.h> Hitung produk kumulatif tensor x sepanjang axis .
Ringkasan
Secara default, operasi ini menjalankan cumprod inklusif, yang berarti elemen pertama masukan identik dengan elemen pertama keluaran:
tf.cumprod([a, b, c]) # => [a, a * b, a * b * c] Dengan menyetel kwarg exclusive ke True , cumprod eksklusif akan dijalankan:
tf.cumprod([a, b, c], exclusive=True) # => [1, a, a * b]
Dengan mengatur kwarg reverse ke True , cumprod dilakukan dalam arah yang berlawanan:
tf.cumprod([a, b, c], reverse=True) # => [a * b * c, b * c, c] Ini lebih efisien daripada menggunakan operasi tf.reverse terpisah.
Kwarg reverse dan exclusive juga dapat digabungkan:
tf.cumprod([a, b, c], exclusive=True, reverse=True) # => [b * c, c, 1]
Argumen:
- ruang lingkup: Objek Lingkup
- x:
Tensor. Harus berupa salah satu dari jenis 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 cumprod eksklusif. - terbalik:
bool(default: False).
Pengembalian:
-
Output: Tensor keluar.
Konstruktor dan Destruktor | |
|---|---|
Cumprod (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input axis) | |
Cumprod (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input axis, const Cumprod::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:: Cumprod:: Attrs | Penyetel atribut opsional untuk Cumprod . |
Atribut publik
operasi
Operation operation
keluar
::tensorflow::Output out
Fungsi publik
Cumprod
Cumprod( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input axis )
Cumprod
Cumprod( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input axis, const Cumprod::Attrs & attrs )
simpul
::tensorflow::Node * node() const
operator::tensorflow::Masukan
operator::tensorflow::Input() const
operator::tensorflow::Keluaran
operator::tensorflow::Output() const
Fungsi statis publik
Eksklusif
Attrs Exclusive( bool x )
Balik
Attrs Reverse( bool x )