mindspore.numpy.cumprod
- mindspore.numpy.cumprod(a, axis=None, dtype=None)[源代码]
Returns the cumulative product of elements along a given axis.
说明
Numpy argument out is not supported.
- 参数
- 返回
Tensor.
- 异常
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
样例
>>> import mindspore.numpy as np >>> x = np.array([1, 2, 3]) >>> print(np.cumprod(x)) [1 2 6]