peal.global_utils.propagate_seed

peal.global_utils.propagate_seed(config)[source]

Copy the top-level seed into every nested config that has one.

Walks all attributes, list entries and dict values of config and sets their seed attribute to config.seed, so that a single seed in the top-level config governs data, generator, predictor and explainer alike. Does nothing when the top-level config has no seed or it is None, and silently skips attributes that refuse assignment.

Parameters:

config (object) – Config tree, modified in place.