Skip to content
Merged
Changes from all commits
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
8 changes: 7 additions & 1 deletion torchrl/envs/batched_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,7 @@ def look_for_cuda(tensor, has_cuda=has_cuda):
env_fun = self.create_env_fn[idx]
if not isinstance(env_fun, (EnvCreator, CloudpickleWrapper)):
env_fun = CloudpickleWrapper(env_fun)

kwargs[idx].update(
{
"parent_pipe": parent_pipe,
Expand All @@ -1486,7 +1487,7 @@ def look_for_cuda(tensor, has_cuda=has_cuda):
"has_lazy_inputs": self.has_lazy_inputs,
"num_threads": num_sub_threads,
"non_blocking": self.non_blocking,
"filter_warnings": torchrl.filter_warnings_subprocess,
"filter_warnings": self._filter_warnings_subprocess(),
}
)
if self._use_buffers:
Expand Down Expand Up @@ -1522,6 +1523,11 @@ def look_for_cuda(tensor, has_cuda=has_cuda):
self.is_closed = False
self.set_spec_lock_()

def _filter_warnings_subprocess(self) -> bool:
from torchrl import filter_warnings_subprocess

return filter_warnings_subprocess

@_check_start
def state_dict(self) -> OrderedDict:
state_dict = OrderedDict()
Expand Down
Loading