Created by: songyouwei
新增enable_dygraph
和disable_dygraph
接口,支持函数式启动关闭动态图模式
sample code:
import paddle.fluid as fluid
import numpy as np
data = np.random.uniform( -1, 1, [30, 10, 32] ).astype('float32')
fluid.enable_dygraph() # Now we are in dygragh mode
data = fluid.dygraph.to_variable(data, name='data')
print(fluid.in_dygraph_mode()) # True
fluid.disable_dygraph()
data = fluid.dygraph.to_variable(data, name='data') # AssertionError