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.

Examples

# required: distributed
import paddle

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

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