Skip to content

Commit

Permalink
_zip_strict
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinebrl authored and vmoens committed Oct 9, 2024
1 parent 8093908 commit 8dc35ec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions torchrl/envs/batched_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import torch

from tensordict import (
_zip_strict,
is_tensor_collection,
LazyStackedTensorDict,
TensorDict,
Expand Down Expand Up @@ -544,9 +545,7 @@ def update_kwargs(self, kwargs: Union[dict, List[dict]]) -> None:
raise RuntimeError(
f"len(kwargs) and num_workers mismatch, got {len(kwargs)} and {self.num_workers}."
)
for _kwargs, _new_kwargs in zip(
self.create_env_kwargs, kwargs, strict=True
):
for _kwargs, _new_kwargs in _zip_strict(self.create_env_kwargs, kwargs):
_kwargs.update(_new_kwargs)

def _get_in_keys_to_exclude(self, tensordict):
Expand Down

0 comments on commit 8dc35ec

Please sign in to comment.