disable_dygraph

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

该接口关闭动态图模式。

推荐使用 disable_imperative

返回

代码示例

  1. import paddle.fluid as fluid
  2. import numpy as np
  3. fluid.enable_dygraph() # Now we are in dygraph mode
  4. print(fluid.in_dygraph_mode()) # True
  5. fluid.disable_dygraph()
  6. print(fluid.in_dygraph_mode()) # False