diff --git a/torchrl/envs/libs/vmas.py b/torchrl/envs/libs/vmas.py index 399f15562a6..22f9835303b 100644 --- a/torchrl/envs/libs/vmas.py +++ b/torchrl/envs/libs/vmas.py @@ -96,10 +96,9 @@ def _vmas_to_torchrl_spec_transform( ) elif isinstance(spec, gym_spaces.Dict): spec_out = {} - for k in spec.keys(): - key = k + for key in spec.keys(): spec_out[key] = _vmas_to_torchrl_spec_transform( - spec[k], + spec[key], device=device, categorical_action_encoding=categorical_action_encoding, )