Skip to content

Commit 8b62e81

Browse files
committed
cumprod example
1 parent f525c8d commit 8b62e81

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pytensor/tensor/extra_ops.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,19 @@ def cumprod(x, axis=None):
439439
axis
440440
The axis along which the cumulative product is computed.
441441
The default (None) is to compute the `cumprod` over the flattened array.
442+
# noqa W293
443+
Example
444+
-------
445+
Usage in PyMC:
442446
447+
.. code-block:: python
448+
449+
import pymc as pm
450+
451+
with pm.Model() as model:
452+
x = pm.Normal('x', shape=(10, 3))
453+
# Product of x
454+
prod_x = pm.Deterministic('prod_x', pm.math.cumprod(x, axis=0))
443455
444456
.. versionadded:: 0.7
445457

0 commit comments

Comments
 (0)