mirror of
https://github.com/nod-ai/AMD-SHARK-Studio.git
synced 2026-04-03 03:00:17 -04:00
Fix repeatable seeds consistency over batch counts (#1889)
* Set the input seed for the random number generator when generating repeatable seeds to exclude any negative numbers in the parsed seed input. The makes seeds generated for different batch counts consistent where they have the same input for the initial seed or set of seeds.
This commit is contained in:
@@ -808,7 +808,7 @@ def batch_seeds(
|
||||
saved_random_state = random_getstate()
|
||||
if all(seed < 0 for seed in seeds):
|
||||
seeds[0] = sanitize_seed(seeds[0])
|
||||
seed_random(str(seeds))
|
||||
seed_random(str([n for n in seeds if n > -1]))
|
||||
|
||||
# generate any seeds that are unspecified
|
||||
seeds = [sanitize_seed(seed) for seed in seeds]
|
||||
|
||||
Reference in New Issue
Block a user