Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Dynamic specs #2143

Merged
merged 27 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
amend
  • Loading branch information
vmoens committed May 29, 2024
commit d1a052fefe0846030d510225fe310a1710b310e3
1 change: 1 addition & 0 deletions test/test_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1840,6 +1840,7 @@ def test_set_truncated(collector_cls):
break
finally:
collector.shutdown()
del collector


class TestNestedEnvsCollector:
Expand Down
1 change: 1 addition & 0 deletions torchrl/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def _check_for_faulty_process(processes):
for _p in processes:
if _p.is_alive():
_p.terminate()
_p.close()
if terminate:
break
if terminate:
Expand Down
7 changes: 2 additions & 5 deletions torchrl/collectors/collectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,9 +809,6 @@ def _set_truncated_keys(self):
self._truncated_keys = [
key for key in self.env.done_keys if _ends_with(key, "truncated")
]
self._truncated_keys = self._truncated_keys + [
unravel_key(("next", key)) for key in self._truncated_keys
]

@classmethod
def _get_devices(
Expand Down Expand Up @@ -1779,8 +1776,8 @@ def _shutdown_main(self) -> None:
self.queue_out.close()
for pipe in self.pipes:
pipe.close()
for proc in self.procs:
proc.join(1.0)
for proc in self.procs:
proc.join(1.0)
finally:
import torchrl

Expand Down
Loading