Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Uni-Core
Commits
ee13d84f
Unverified
Commit
ee13d84f
authored
Mar 05, 2023
by
Ziyao Li
Committed by
GitHub
Mar 05, 2023
Browse files
fix numpy seed key ignorance (#20)
parent
3aa106dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
unicore/data/data_utils.py
unicore/data/data_utils.py
+2
-2
No files found.
unicore/data/data_utils.py
View file @
ee13d84f
...
...
@@ -94,8 +94,8 @@ def numpy_seed(seed, *addl_seeds, key=None):
for
s
in
addl_seeds
:
check_seed
(
s
)
seed
=
int
(
hash
((
seed
,
*
addl_seeds
))
%
1e8
)
if
key
is
not
None
:
seed
=
int
(
hash
((
seed
,
str_hash
(
key
)))
%
1e8
)
if
key
is
not
None
:
seed
=
int
(
hash
((
seed
,
str_hash
(
key
)))
%
1e8
)
state
=
np
.
random
.
get_state
()
np
.
random
.
seed
(
seed
)
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment