2.3K Star 8.1K Fork 4.3K

GVPMindSpore / mindspore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mindspore.ops.CumProd.rst 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
宦晓玲 提交于 2024-02-19 16:26 . modify the inconsistence in 2.3

mindspore.ops.CumProd

.. py:class:: mindspore.ops.CumProd(exclusive=False, reverse=False)

    计算 `x` 沿着指定axis的元素累计积。

    例如,如果输入是长度为N的vector,则输出也是长度为N的vector。其中的每一个元素为

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

    参数:
        - **exclusive** (bool) - 如果为 ``True`` ,则排除末尾元素计算元素累计积(见样例)。默认值: ``False`` 。
        - **reverse** (bool) - 如果为 ``True`` ,则沿 `axis` 反转结果。默认值: ``False`` 。

    输入:
        - **x** (Tensor[Number]) - 输入Tensor。shape为 :math:`(N, *)` ,其中 :math:`*` 为任意数量的额外维度。
        - **axis** (int) - 沿此方向计算累计积。仅支持常量值。

    输出:
        Tensor,shape和数据类型与 `x` 相同。

    异常:
        - **TypeError** - `exclusive` 或 `reverse` 不是bool类型。
        - **TypeError** - `axis` 不是int。
        - **ValueError** - `axis` 是None。
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
master

搜索帮助