torch_ecg.utils.seed_everything#

torch_ecg.utils.seed_everything(seed: int) → None[source]#

Seed all random number generators used by torch_ecg (and by the libraries it relies on).

This is an alias of DEFAULTS.set_seed: it (re)creates DEFAULTS.RNG (numpy.random.Generator), and seeds the global random and numpy.random states and the torch (CPU and CUDA) generators.

Parameters:

seed (int) – The seed to be set.

Examples

from torch_ecg.utils import seed_everything

seed_everything(42)