.. note:: This API has no effect in Dygraph mode. Get the current :ref:`api_guide_Block_en` . The :code:`current` :ref:`api_guide_Block_en` is the :ref:`api_guide_Block_en` to append operators. Returns: :ref:`api_guide_Block_en`: The :c
(self)
| 7266 | return self.blocks[index] |
| 7267 | |
| 7268 | def current_block(self): |
| 7269 | """ |
| 7270 | .. note:: |
| 7271 | This API has no effect in Dygraph mode. |
| 7272 | |
| 7273 | Get the current :ref:`api_guide_Block_en` . The :code:`current` :ref:`api_guide_Block_en` |
| 7274 | is the :ref:`api_guide_Block_en` to append operators. |
| 7275 | |
| 7276 | Returns: |
| 7277 | :ref:`api_guide_Block_en`: The :code:`index` :ref:`api_guide_Block_en` |
| 7278 | |
| 7279 | Examples: |
| 7280 | .. code-block:: pycon |
| 7281 | |
| 7282 | >>> import paddle |
| 7283 | >>> import paddle.static as static |
| 7284 | |
| 7285 | >>> paddle.enable_static() |
| 7286 | |
| 7287 | >>> prog = static.default_main_program() |
| 7288 | >>> current_blk = prog.current_block() |
| 7289 | >>> print(current_blk) |
| 7290 | """ |
| 7291 | return self.blocks[self.current_block_idx] |
| 7292 | |
| 7293 | def _create_block(self, parent_idx=None): |
| 7294 | """ |
no outgoing calls