Skip to content

Commit

Permalink
amend
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens committed Feb 15, 2024
1 parent 263140f commit ec6a636
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion torchrl/envs/transforms/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -4254,9 +4254,14 @@ def transform_observation_spec(
return observation_spec

def transform_input_spec(self, input_spec: TensorSpec) -> TensorSpec:
input_spec["full_state_spec"] = self.transform_observation_spec(
new_state_spec = self.transform_observation_spec(
input_spec["full_state_spec"]
)
for action_key in list(input_spec["full_action_spec"].keys(True, True)):
if action_key in new_state_spec.keys(True, True):
input_spec["full_action_spec", action_key] = new_state_spec[action_key]
del new_state_spec[action_key]
input_spec["full_state_spec"] = new_state_spec
return input_spec

@property
Expand Down

0 comments on commit ec6a636

Please sign in to comment.