MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / set_random_state

Method set_random_state

monai/transforms/compose.py:287–293  ·  view source on GitHub ↗
(self, seed: int | None = None, state: np.random.RandomState | None = None)

Source from the content-addressed store, hash-verified

285 self._lazy = val
286
287 def set_random_state(self, seed: int | None = None, state: np.random.RandomState | None = None) -> Compose:
288 super().set_random_state(seed=seed, state=state)
289 for _transform in self.transforms:
290 if not isinstance(_transform, Randomizable):
291 continue
292 _transform.set_random_state(seed=int(self.R.randint(MAX_SEED, dtype="uint32")))
293 return self
294
295 def randomize(self, data: Any | None = None) -> None:
296 for _transform in self.transforms:

Callers 15

__init__Method · 0.95
run_training_testFunction · 0.95
test_inverse_composeMethod · 0.95
run_training_testFunction · 0.95
test_random_composeMethod · 0.95
test_data_loaderMethod · 0.95
test_samplesMethod · 0.95
__init__Method · 0.45
__init__Method · 0.45
__getitem__Method · 0.45
set_rndFunction · 0.45

Calls

no outgoing calls

Tested by 15

run_training_testFunction · 0.76
test_inverse_composeMethod · 0.76
run_training_testFunction · 0.76
test_random_composeMethod · 0.76
test_data_loaderMethod · 0.76
test_samplesMethod · 0.76
test_resampler_lazyFunction · 0.36
__getitem__Method · 0.36
run_transformMethod · 0.36
test_maskMethod · 0.36