Skip to content

Commit 817e892

Browse files
malfetVincent Moens
andauthored
Update advanced_source/coding_ddpg.py
Co-authored-by: Vincent Moens <[email protected]>
1 parent 8870fef commit 817e892

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

advanced_source/coding_ddpg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@
7070
# TorchRL prefers spawn method, that restricts creation of ``~torchrl.envs.ParallelEnv`` inside
7171
# `__main__` method call, but for the easy of reading the code switch to fork
7272
# which is also a default spawn method in Google's Colaboratory
73-
multiprocessing.set_start_method("fork")
73+
try:
74+
multiprocessing.set_start_method("fork")
75+
except RuntimeError:
76+
assert multiprocessing.get_start_method() == "fork"
7477
# sphinx_gallery_end_ignore
7578

7679

0 commit comments

Comments
 (0)