resolve_seed#
- bayesflow.utils.resolve_seed(seed, seed_generator)[source]#
Resolve a user-provided
seedagainst an instance’s own seed generator.An integer is converted to a fresh
SeedGenerator, aSeedGeneratoris passed through unchanged, andNonefalls back toseed_generator.Every object that owns randomness passes its own
self.seed_generatorhere, whether it draws itself or fans the seed out to sub-components. Draws therefore never fall through to Keras’ global generator (which cannot be traced underjax.jit), and an integer seed becomes one generator shared by all sub-components and batches of the call, rather than one identically seeded generator per draw site.