:api_attr: Static Graph Get the global/default scope instance. There are a lot of APIs use :code:`global_scope` as its default value, e.g., :code:`Executor.run` Returns: Scope: The global/default scope instance. Examples: .. code-block:: pycon >>>
()
| 74 | |
| 75 | |
| 76 | def global_scope() -> core._Scope: |
| 77 | """ |
| 78 | :api_attr: Static Graph |
| 79 | |
| 80 | Get the global/default scope instance. There are a lot of APIs use |
| 81 | :code:`global_scope` as its default value, e.g., :code:`Executor.run` |
| 82 | |
| 83 | Returns: |
| 84 | Scope: The global/default scope instance. |
| 85 | |
| 86 | Examples: |
| 87 | .. code-block:: pycon |
| 88 | |
| 89 | >>> import paddle |
| 90 | >>> import numpy |
| 91 | |
| 92 | >>> paddle.static.global_scope().var("data").get_tensor().set(numpy.ones((2, 2)), paddle.CPUPlace()) |
| 93 | >>> numpy.array(paddle.static.global_scope().find_var("data").get_tensor()) |
| 94 | """ |
| 95 | return g_scope |
| 96 | |
| 97 | |
| 98 | def _switch_scope(scope: core._Scope) -> core._Scope: |
no outgoing calls