Return early in `reset_seed` (#11983)
This commit is contained in:
parent
4f68c635a1
commit
244f365fae
|
@ -87,9 +87,10 @@ def reset_seed() -> None:
|
|||
If :func:`pytorch_lightning.utilities.seed.seed_everything` is unused, this function will do nothing.
|
||||
"""
|
||||
seed = os.environ.get("PL_GLOBAL_SEED", None)
|
||||
if seed is None:
|
||||
return
|
||||
workers = os.environ.get("PL_SEED_WORKERS", "0")
|
||||
if seed is not None:
|
||||
seed_everything(int(seed), workers=bool(int(workers)))
|
||||
seed_everything(int(seed), workers=bool(int(workers)))
|
||||
|
||||
|
||||
def pl_worker_init_function(worker_id: int, rank: Optional[int] = None) -> None: # pragma: no cover
|
||||
|
|
Loading…
Reference in New Issue