Refactor `_get_rank` utility to take strategy instead of trainer (#14546)
This commit is contained in:
parent
06fa9ea3e0
commit
59fcabf53a
|
@ -261,7 +261,7 @@ class EarlyStopping(Callback):
|
|||
|
||||
@staticmethod
|
||||
def _log_info(trainer: Optional["pl.Trainer"], message: str, log_rank_zero_only: bool) -> None:
|
||||
rank = _get_rank(trainer)
|
||||
rank = _get_rank(strategy=(trainer.strategy if trainer is not None else None))
|
||||
if trainer is not None and trainer.world_size <= 1:
|
||||
rank = None
|
||||
message = rank_prefixed_message(message, rank)
|
||||
|
|
Loading…
Reference in New Issue