.. note:: This API has no effect in Dygraph mode. Get the :code:`index` :ref:`api_guide_Block_en` of this Program Args: index (int): The index of :ref:`api_guide_Block_en` to get Returns: :ref:`api_guide_Block_en`: The :code
(self, index)
| 7239 | return self.blocks[0] |
| 7240 | |
| 7241 | def block(self, index): |
| 7242 | """ |
| 7243 | .. note:: |
| 7244 | This API has no effect in Dygraph mode. |
| 7245 | |
| 7246 | Get the :code:`index` :ref:`api_guide_Block_en` of this Program |
| 7247 | |
| 7248 | Args: |
| 7249 | index (int): The index of :ref:`api_guide_Block_en` to get |
| 7250 | |
| 7251 | Returns: |
| 7252 | :ref:`api_guide_Block_en`: The :code:`index` block |
| 7253 | |
| 7254 | Examples: |
| 7255 | .. code-block:: pycon |
| 7256 | |
| 7257 | >>> import paddle |
| 7258 | >>> import paddle.static as static |
| 7259 | |
| 7260 | >>> paddle.enable_static() |
| 7261 | |
| 7262 | >>> prog = static.default_main_program() |
| 7263 | >>> block_0 = prog.block(0) |
| 7264 | >>> print(block_0) |
| 7265 | """ |
| 7266 | return self.blocks[index] |
| 7267 | |
| 7268 | def current_block(self): |
| 7269 | """ |
no outgoing calls