From 15984e12795084affb516f2c8d76ab43a1d0a5d1 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Thu, 24 Feb 2022 11:48:34 +0000 Subject: [PATCH] clarify the usage of set determinism Signed-off-by: Wenqi Li --- monai/utils/misc.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/monai/utils/misc.py b/monai/utils/misc.py index 022cd2c58a..1c79562f07 100644 --- a/monai/utils/misc.py +++ b/monai/utils/misc.py @@ -239,6 +239,13 @@ def set_determinism( use_deterministic_algorithms: Set whether PyTorch operations must use "deterministic" algorithms. additional_settings: additional settings that need to set random seed. + Note: + + This function will not affect the randomizable objects in :py:class:`monai.transforms.Randomizable`, which + have independent random states. For those objects, the ``set_random_state()`` method should be used to + ensure the deterministic behavior (alternatively, :py:class:`monai.data.DataLoader` by default sets the seeds + according to the global random state, please see also: :py:class:`monai.data.utils.worker_init_fn` and + :py:class:`monai.data.utils.set_rnd`). """ if seed is None: # cast to 32 bit seed for CUDA