mindspore/docs/api/api_python/ops/mindspore.ops.func_cumprod.rst

24 lines
955 B
ReStructuredText
Raw Normal View History

mindspore.ops.cumprod
======================
.. py:function:: mindspore.ops.cumprod(input, dim, dtype=None)
返回输入的元素在 `dim` 维度上的累积乘积。
例如,如果 `input` 是大小为N的向量则结果也将是大小为N的向量带有元素
2022-10-21 18:52:11 +08:00
.. math::
y_i = x_1 * x_2 * x_3 * ... * x_i
参数:
- **input** (Tensor[Number]) - 输入Tensor必须是数字类型。:math:`(N,*)` ,其中 :math:`*` 表示任何额外的维度其秩都应该小于8。
- **dim** (int) - 计算累积乘积的尺寸。只允许常量值。
- **dtype** - 输出的数据类型。默认值None。
返回:
Tensor数据类型和shape与 `input` 相同,除非指定了 `dtype`
异常:
- **TypeError** - 如果 `dim` 不是int。
- **TypeError** - 如果 `dtype` 无法进行转换。
- **ValueError** - 如果 `dim` 是None。