2.3K Star 8.1K Fork 4.3K

GVPMindSpore / mindspore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mindspore.ops.func_cumprod.rst 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
wind-zyx 提交于 2023-04-20 20:21 . ops update value format 0420

mindspore.ops.cumprod

.. py:function:: mindspore.ops.cumprod(input, dim, dtype=None)

    返回输入的元素在 `dim` 维度上的累积乘积。
    例如,如果 `input` 是大小为N的向量,则结果也将是大小为N的向量(带有元素)。

    .. math::
        y_i = x_1 * x_2 * x_3 * ... * x_i

    参数:
        - **input** (Tensor[Number]) - 输入Tensor,必须是数字类型。:math:`(N,*)` ,其中 :math:`*` 表示任何额外的维度。
        - **dim** (int) - 计算累积乘积的尺寸。只允许常量值。
        - **dtype** (:class:`mindspore.dtype`, 可选) - 输出的数据类型。如果为None,则输出和输入的数据类型一致。默认值: ``None`` 。

    返回:
        Tensor,数据类型和shape与 `input` 相同,除非指定了 `dtype`。

    异常:
        - **TypeError** -  如果 `dim` 不是int。
        - **TypeError** -  如果 `dtype` 无法进行转换。
        - **ValueError** - 如果 `dim` 是None。
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
master

搜索帮助