disable_dygraph

paddle.fluid.dygraph.disable_dygraph()[源代码]

该接口关闭动态图模式。

注解

推荐使用 disable_imperative

返回

代码示例

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