disable_dygraph_cn.rst 453 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
.. _cn_api_fluid_disable_dygraph:

disable_dygraph
-------------------------------

.. py:function:: paddle.fluid.disable_dygraph()

该接口关闭动态图模式。

返回:无

**示例代码**

.. code-block:: python

    import paddle.fluid as fluid
    import numpy as np
    fluid.enable_dygraph()  # Now we are in dygraph mode
    print(fluid.in_dygraph_mode())  # True
    fluid.disable_dygraph()
    print(fluid.in_dygraph_mode())  # False