Return early in `reset_seed` (#11983)

This commit is contained in:
ananthsub 2022-02-25 15:58:27 -08:00 committed by GitHub
parent 4f68c635a1
commit 244f365fae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -87,8 +87,9 @@ 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)))