is_initialized

paddle.distributed. is_initialized ( ) [source]

Check whether the distributed environment has been initialized

Returns

True if distributed environment has been initialized, otherwise False.

Warning

This API only supports the dygraph mode.

Examples

>>> 
>>> import paddle

>>> print(paddle.distributed.is_initialized())
False

>>> paddle.distributed.init_parallel_env()
>>> print(paddle.distributed.is_initialized())
True