selfclean_audio.utils.types#
Members
Ensure the provided configuration is an instance of DictConfig. |
|
Set the random seed for reproducibility across various libraries and frameworks. |
- selfclean_audio.utils.types.set_seeds(_C: DictConfig)[source]#
Set the random seed for reproducibility across various libraries and frameworks.
This function sets the seed for the Python
randommodule, thenumpylibrary, and thetorchlibrary to ensure deterministic behavior. Additionally, it configures CuDNN’s deterministic and benchmarking behavior based on the provided configuration.- Parameters:
_C (DictConfig) – A dict configuration that contains the random seed and CuDNN settings (
seed,cudnn_deterministic, andcudnn_benchmark).
Notes
_C.params.seedshould be an integer value used for seeding._C.params.cudnn_deterministicis a boolean flag that enforces deterministic behavior in CuDNN._C.params.cudnn_benchmarkis a boolean flag that enables CuDNN’s autotuner for optimal performance.