mindspore.numpy.cumprod
- mindspore.numpy.cumprod(a, axis=None, dtype=None)[source]
Returns the cumulative product of elements along a given axis.
Note
Numpy argument out is not supported.
- Parameters
- Returns
Tensor.
- Raises
TypeError – If the input can not be converted to tensor or axis is not integer.
ValueError – If axis is out of range.
- Supported Platforms:
Ascend
GPU
Examples
>>> import mindspore.numpy as np >>> x = np.array([1, 2, 3]) >>> print(np.cumprod(x)) [1 2 6]