enable_dygraph

paddle.fluid.enable_dygraph(place=None)[source]

This function enables dynamic graph mode.

Parameters

place (fluid.CPUPlace or fluid.CUDAPlace, optional) – Place to execute dygraph. If None, the running place will be determined according to the way of paddle compilation. Default: None

Returns

None

Examples

import paddle.fluid as fluid

fluid.enable_dygraph()  # Now we are in dygragh mode
print(fluid.in_dygraph_mode())  # True
fluid.disable_dygraph()
print(fluid.in_dygraph_mode())  # False