Unverified Commit ee13d84f authored by Ziyao Li's avatar Ziyao Li Committed by GitHub
Browse files

fix numpy seed key ignorance (#20)

parent 3aa106dc
...@@ -94,8 +94,8 @@ def numpy_seed(seed, *addl_seeds, key=None): ...@@ -94,8 +94,8 @@ def numpy_seed(seed, *addl_seeds, key=None):
for s in addl_seeds: for s in addl_seeds:
check_seed(s) check_seed(s)
seed = int(hash((seed, *addl_seeds)) % 1e8) seed = int(hash((seed, *addl_seeds)) % 1e8)
if key is not None: if key is not None:
seed = int(hash((seed, str_hash(key))) % 1e8) seed = int(hash((seed, str_hash(key))) % 1e8)
state = np.random.get_state() state = np.random.get_state()
np.random.seed(seed) np.random.seed(seed)
try: try:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment