disable_imperative

paddle.fluid.disable_imperative()[source]

This function disables imperative mode.

Returns

None

Examples

import paddle.fluid as fluid

fluid.enable_imperative()  # Now we are in imperative mode
x = fluid.layers.ones( (2, 2), "float32")
y = fluid.layers.zeros( (2, 2), "float32")
z = x + y
print( z.numpy() )   #[[1, 1], [1, 1]]
fluid.disable_imperative() # Now we are in declarative mode