global_scope

paddle.fluid.executor.global_scope()[source]

Get the global/default scope instance. There are a lot of APIs use global_scope as its default value, e.g., Executor.run

Returns

The global/default scope instance.

Return type

Scope

Examples

import paddle.fluid as fluid
import numpy

fluid.global_scope().var("data").get_tensor().set(numpy.ones((2, 2)), fluid.CPUPlace())
numpy.array(fluid.global_scope().find_var("data").get_tensor())