Shortcuts

rank_zero

Functions

rank_zero_debug

Function used to log debug-level messages only on rank 0.

rank_zero_info

Function used to log info-level messages only on rank 0.

rank_zero_only

Function that can be used as a decorator to enable a function/method being called only on rank 0.

rank_zero_warn

Function used to log warn-level messages only on rank 0.

Exceptions

LightningDeprecationWarning

Deprecation warnings raised by PyTorch Lightning.

Utilities that can be used for calling functions on a particular rank.

exception pytorch_lightning.utilities.rank_zero.LightningDeprecationWarning[source]

Bases: DeprecationWarning

Deprecation warnings raised by PyTorch Lightning.

pytorch_lightning.utilities.rank_zero.rank_zero_debug(*args, stacklevel=4, **kwargs)[source]

Function used to log debug-level messages only on rank 0.

Return type

None

pytorch_lightning.utilities.rank_zero.rank_zero_deprecation(message: Union[str, Warning], stacklevel: int = 4, **kwargs: Any) None

Function used to log warn-level messages only on rank 0.

pytorch_lightning.utilities.rank_zero.rank_zero_info(*args, stacklevel=4, **kwargs)[source]

Function used to log info-level messages only on rank 0.

Return type

None

pytorch_lightning.utilities.rank_zero.rank_zero_only(fn)[source]

Function that can be used as a decorator to enable a function/method being called only on rank 0.

Return type

Callable

pytorch_lightning.utilities.rank_zero.rank_zero_warn(message, stacklevel=4, **kwargs)[source]

Function used to log warn-level messages only on rank 0.

Return type

None