ray.data.RandomSeedConfig.create_seed_config#
- classmethod RandomSeedConfig.create_seed_config(seed: int | RandomSeedConfig | None, *, use_timestamp_as_default: bool = False) RandomSeedConfig[source]#
Create a
RandomSeedConfigobject from theseedargument in Ray Data public random APIs.This is a helper function that converts an integer seed into a
RandomSeedConfigobject. In this case,reseed_after_executionis set to False, which matches the standard behavior for a data pipeline (i.e., same seed across executions). To override this behavior, use aRandomSeedConfigobject directly.- Parameters:
seed – This optional argument can be an integer or an existing
RandomSeedConfigobject.use_timestamp_as_default – If True, a timestamp-based seed is used when
seedis None. This pins the seed at plan time so that task retries produce identical output. Whenseedis an existingRandomSeedConfig, this value overrides itsuse_timestamp_as_defaultfield.
- Returns:
A
RandomSeedConfigobject.