We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
reset_seed
1 parent 4f68c63 commit 244f365Copy full SHA for 244f365
pytorch_lightning/utilities/seed.py
@@ -87,9 +87,10 @@ def reset_seed() -> None:
87
If :func:`pytorch_lightning.utilities.seed.seed_everything` is unused, this function will do nothing.
88
"""
89
seed = os.environ.get("PL_GLOBAL_SEED", None)
90
+ if seed is None:
91
+ return
92
workers = os.environ.get("PL_SEED_WORKERS", "0")
- if seed is not None:
- seed_everything(int(seed), workers=bool(int(workers)))
93
+ seed_everything(int(seed), workers=bool(int(workers)))
94
95
96
def pl_worker_init_function(worker_id: int, rank: Optional[int] = None) -> None: # pragma: no cover
0 commit comments