Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
vmoens committed Dec 12, 2024
2 parents b6d765e + 444548b commit 0f67077
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion torchrl/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def check_env_specs(self, *args, **kwargs):

check_env_specs.__doc__ = check_env_specs_func.__doc__

def cardinality(self, tensordict: TensorDictBase|None=None) -> int:
def cardinality(self, tensordict: TensorDictBase | None = None) -> int:
"""The cardinality of the action space.
By default, this is just a wrapper around :meth:`env.action_space.cardinality <~torchrl.data.TensorSpec.cardinality>`.
Expand Down
3 changes: 1 addition & 2 deletions torchrl/envs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,7 @@ def check_env_specs(
if _has_dynamic_specs(env.specs):
for real, fake in zip(
real_tensordict_select.filter_non_tensor_data().unbind(-1),
fake_tensordict_select.filter_non_tensor_data().unbind(-1)
,
fake_tensordict_select.filter_non_tensor_data().unbind(-1),
):
fake = fake.apply(lambda x, y: x.expand_as(y), real)
if (torch.zeros_like(real) != torch.zeros_like(fake)).any():
Expand Down

0 comments on commit 0f67077

Please sign in to comment.