Skip to content

Commit 9990179

Browse files
authored
[DLMED] simplify random seed (#2875)
Signed-off-by: Nic Ma <[email protected]>
1 parent b0c83db commit 9990179

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

monai/utils/misc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ def set_determinism(
235235
if seed is None:
236236
# cast to 32 bit seed for CUDA
237237
seed_ = torch.default_generator.seed() % (np.iinfo(np.int32).max + 1)
238-
if not torch.cuda._is_in_bad_fork():
239-
torch.cuda.manual_seed_all(seed_)
238+
torch.manual_seed(seed_)
240239
else:
241240
seed = int(seed) % MAX_SEED
242241
torch.manual_seed(seed)

0 commit comments

Comments
 (0)