tensorflow::ops::Cumprod

#include <math_ops.h>

Hitung hasil perkalian kumulatif tensor x sepanjang axis .

Ringkasan

Secara default, operasi ini melakukan cumprod inklusif, yang berarti elemen pertama dari input identik dengan elemen pertama dari output:

tf.cumprod([a, b, c])  # => [a, a * b, a * b * c]

Dengan mengatur kata kunci exclusive menjadi True , maka akan dilakukan cumprod eksklusif sebagai gantinya:

tf.cumprod([a, b, c], exclusive=True)  # => [1, a, a * b]

Dengan mengatur kwarg reverse menjadi True , cumprod dilakukan ke 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.

Kata kunci reverse dan exclusive juga dapat dikombinasikan:

tf.cumprod([a, b, c], exclusive=True, reverse=True)  # => [b * c, c, 1]

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: Tensor bertipe int32 (default: 0). Harus berada dalam rentang [-rank(x), rank(x)) .

Atribut opsional (lihat Attrs ):

  • eksklusif: Jika True , lakukan cumprod eksklusif.
  • reverse: Sebuah bool (nilai default: False).

Mengembalikan:

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

Pengaturan 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::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
)