MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / global_block

Method global_block

python/paddle/base/framework.py:7215–7239  ·  view source on GitHub ↗

.. note:: This API has no effect in Dygraph mode. Get the first :ref:`api_guide_Block_en` of this Program. Returns: :ref:`api_guide_Block_en`: The first :ref:`api_guide_Block_en` of this Program. Examples: .. code-block:: pyco

(self)

Source from the content-addressed store, hash-verified

7213 return self.__str__()
7214
7215 def global_block(self):
7216 """
7217 .. note::
7218 This API has no effect in Dygraph mode.
7219
7220 Get the first :ref:`api_guide_Block_en` of this Program.
7221
7222 Returns:
7223 :ref:`api_guide_Block_en`: The first :ref:`api_guide_Block_en` of this Program.
7224
7225
7226 Examples:
7227 .. code-block:: pycon
7228
7229 >>> import paddle
7230 >>> import paddle.static as static
7231
7232 >>> paddle.enable_static()
7233
7234 >>> prog = static.default_main_program()
7235 >>> gb_block = prog.global_block()
7236 >>> print(gb_block)
7237
7238 """
7239 return self.blocks[0]
7240
7241 def block(self, index):
7242 """

Callers 15

loadFunction · 0.95
_serialize_persistablesFunction · 0.95
deserialize_persistablesFunction · 0.95
save_varsFunction · 0.95
load_varsFunction · 0.95
load_program_stateFunction · 0.95
__load_persistable_varsFunction · 0.95
__save_remote_paramsFunction · 0.95

Calls

no outgoing calls

Tested by 15

test_singleMethod · 0.76
test_distMethod · 0.76
test_baseMethod · 0.76
test_device_guardMethod · 0.76
gaussian_random_testMethod · 0.76
get_grad_with_placeMethod · 0.76
test_trainMethod · 0.76
test_skip_vjpMethod · 0.76