.. 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)
| 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 | """ |
no outgoing calls