Seed documentation
This commit is contained in:
parent
1cad98fcf9
commit
a47f3f6037
1 changed files with 8 additions and 0 deletions
|
@ -4,6 +4,14 @@ import random
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
def set_seed(SEED):
|
def set_seed(SEED):
|
||||||
|
"""
|
||||||
|
Set the seed for repeatability purposes.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
SEED : int
|
||||||
|
The seed to set numpy, random, and torch to.
|
||||||
|
"""
|
||||||
# Set `PYTHONHASHSEED` environment variable at a fixed value
|
# Set `PYTHONHASHSEED` environment variable at a fixed value
|
||||||
environ['PYTHONHASHSEED'] = str(SEED)
|
environ['PYTHONHASHSEED'] = str(SEED)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue