tensorflow::ops::Cumprod
#include <math_ops.h>
Вычисляет кумулятивное произведение тензора x вдоль оси axis.
Краткое описание
По умолчанию эта операция вычисляет включительное кумулятивное произведение, то есть первый элемент входных данных совпадает с первым элементом выходных данных:
tf.cumprod([a, b, c]) # => [a, a * b, a * b * c]
Если задать для именованного аргумента exclusive значение True, вместо этого вычисляется исключительное кумулятивное произведение:
tf.cumprod([a, b, c], exclusive=True) # => [1, a, a * b]
Если задать для именованного аргумента reverse значение True, кумулятивное произведение вычисляется в обратном направлении:
tf.cumprod([a, b, c], reverse=True) # => [a * b * c, b * c, c]
Это эффективнее, чем использовать отдельные операции tf.reverse.
Именованные аргументы reverse и exclusive также можно объединить:
tf.cumprod([a, b, c], exclusive=True, reverse=True) # => [b * c, c, 1]
Аргументы:
- scope: объект Scope
- x:
Tensor. Допустимые типы:float32,float64,int64,int32,uint8,uint16,int16,int8,complex64,complex128,qint8,quint8,qint32,half. - axis:
Tensorтипаint32(по умолчанию: 0). Значение должно находиться в диапазоне[-rank(x), rank(x)).
Необязательные атрибуты (см. Attrs):
- exclusive: если
True, вычислять исключительное кумулятивное произведение. - reverse:
bool(по умолчанию: False).
Возвращает:
-
Output: выходной тензор.
| Конструкторы и деструкторы | |
|---|---|
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) |
| Открытые атрибуты | |
|---|---|
operation | |
out | |
| Открытые функции | |
|---|---|
node() const | ::tensorflow::Node * |
operator::tensorflow::Input() const | |
operator::tensorflow::Output() const | |
| Открытые статические функции | |
|---|---|
Exclusive(bool x) | |
Reverse(bool x) | |
| Структуры | |
|---|---|
| tensorflow::ops::Cumprod::Attrs | Методы задания необязательных атрибутов для Cumprod. |
Открытые атрибуты
operation
Operation operation
out
::tensorflow::Output out
Открытые функции
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 )
node
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Открытые статические функции
Exclusive
Attrs Exclusive( bool x )
Reverse
Attrs Reverse( bool x )
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/cumprod