We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ca4985 commit f525c8dCopy full SHA for f525c8d
pytensor/tensor/extra_ops.py
@@ -410,9 +410,18 @@ def cumsum(x, axis=None):
410
axis
411
The axis along which the cumulative sum is computed.
412
The default (None) is to compute the cumsum over the flattened array.
413
+ # noqa W293
414
+ Example
415
+ -------
416
+ Usage in PyMC:
417
418
+ .. code-block:: python
419
- .. versionadded:: 0.7
420
+ with pm.Model() as model:
421
+ x0 = pm.Normal('x0')
422
+ x = pm.Normal('x', mu=0, sd=1, shape=10)
423
+ # Gaussian random walk
424
+ grw = pm.Deterministic('grw', x0 + pm.math.cumsum(x))
425
426
"""
427
return CumOp(axis=axis, mode="add")(x)
0 commit comments