diff --git a/torchrl/envs/common.py b/torchrl/envs/common.py index f5d102a6279..3b55fd227a7 100644 --- a/torchrl/envs/common.py +++ b/torchrl/envs/common.py @@ -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>`. diff --git a/torchrl/envs/utils.py b/torchrl/envs/utils.py index 8975c1b40e3..f7403e6a69e 100644 --- a/torchrl/envs/utils.py +++ b/torchrl/envs/utils.py @@ -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():