2.3K Star 8.1K Fork 4.3K

GVPMindSpore / mindspore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mindspore.ops.Depend.rst 852 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhangyi 提交于 2022-07-25 15:09 . modify the format of API files

mindspore.ops.Depend

.. py:class:: mindspore.ops.Depend

    用来处理操作间的依赖关系。

    在大多数情况下,如果操作有作用在IO或内存上的副作用,它们将按照用户的指令依序执行。在某些情况下,如果两个操作A和B没有顺序上的依赖性,而A必须在B之前执行,我们建议使用Depend来指定它们的执行顺序。使用方法如下:

    .. code-block::

        a = A(x)                --->        a = A(x)
        b = B(y)                --->        y = Depend(y, a)
                                --->        b = B(y)

    输入:
        - **value** (Tensor) - 应被Depend操作符返回的Tensor。
        - **expr** (Expression) - 应被执行的无输出的表达式。

    输出:
        Tensor,作为 `value` 传入的变量。

Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
master

搜索帮助