The number of :ref:`api_guide_Block_en` in this Program. .. note:: This API has no effect in Dygraph mode. Returns: int(Platform-dependent size): num of :ref:`api_guide_Block_en` in current Program Examples: .. code-block:: p
(self)
| 7176 | |
| 7177 | @property |
| 7178 | def num_blocks(self): |
| 7179 | """ |
| 7180 | The number of :ref:`api_guide_Block_en` in this Program. |
| 7181 | |
| 7182 | .. note:: |
| 7183 | This API has no effect in Dygraph mode. |
| 7184 | |
| 7185 | Returns: |
| 7186 | int(Platform-dependent size): num of :ref:`api_guide_Block_en` in current Program |
| 7187 | |
| 7188 | |
| 7189 | Examples: |
| 7190 | .. code-block:: pycon |
| 7191 | |
| 7192 | >>> import paddle |
| 7193 | >>> import paddle.static as static |
| 7194 | |
| 7195 | >>> paddle.enable_static() |
| 7196 | |
| 7197 | >>> prog = static.default_main_program() |
| 7198 | >>> num_blocks = prog.num_blocks |
| 7199 | >>> print(num_blocks) |
| 7200 | 1 |
| 7201 | """ |
| 7202 | return self.desc.num_blocks() |
| 7203 | |
| 7204 | @random_seed.setter |
| 7205 | def random_seed(self, seed): |
no outgoing calls