Cumprod
tensorflow C++ API
Compute the cumulative product of the tensorx
alongaxis.
.
Summary
By default, this op performs an inclusive cumprod, which means that the first element of the input is identical to the first element of the output: ```prettyprint tf.cumprod([a, b, c]) ==> [a, a * b, a * b * c] ```
By setting theexclusive
kwarg toTrue
, an exclusive cumprod is performed instead: ```prettyprint tf.cumprod([a, b, c], exclusive=True) ==> [1, a, a * b] ```
By setting thereverse
kwarg toTrue
, the cumprod is performed in the opposite direction: ```prettyprint tf.cumprod([a, b, c], reverse=True) ==> [a * b * c, b * c, c] ``This is more efficient than using separate
tf.reverse` ops.
Thereverse
andexclusive
kwargs can also be combined: ```prettyprint tf.cumprod([a, b, c], exclusive=True, reverse=True) ==> [b * c, c, 1] ```
Arguments:
- scope: A Scope object
Returns:
Output
: The out tensor.
Constructor
- Cumprod(const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input axis, const Cumprod::Attrs & attrs).
Public attributes
- tensorflow::Output out.
Cumprod block
Source link : https://github.com/EXPNUNI/enuSpaceTensorflow/blob/master/enuSpaceTensorflow/tf_math.cpp
Argument:
- Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.).
- Input x:connect Input node.
- Input axis:connect Input node. ex) 0 or 1.
- Cumprod ::Attrs attrs:Input attrs in value. ex) exclusive_ = false_; reverse__ =false;
Return:
- Output out: Output object of Cumprod class object.
Result:
- std::vector(Tensor) product_result : Returned object of executed result by calling session.