Skip to content

Commit a1e21f5

Browse files
[BugFix] Wrong spec returned (#2604)
1 parent 00d3199 commit a1e21f5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

torchrl/envs/common.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ def __init__(
390390
self.batch_size = torch.Size(batch_size)
391391
self._run_type_checks = run_type_checks
392392
self._allow_done_after_reset = allow_done_after_reset
393+
393394
@wraps(check_env_specs_func)
394395
def check_env_specs(self, *args, **kwargs):
395396
return check_env_specs_func(self, *args, **kwargs)
@@ -1550,7 +1551,7 @@ def action_spec_unbatched(self, spec: Composite):
15501551
@property
15511552
def full_observation_spec_unbatched(self) -> Composite:
15521553
"""Returns the observation spec of the env as if it had no batch dimensions."""
1553-
return self._make_single_env_spec(self.full_action_spec)
1554+
return self._make_single_env_spec(self.full_observation_spec)
15541555

15551556
@full_observation_spec_unbatched.setter
15561557
def full_observation_spec_unbatched(self, spec: Composite):
@@ -1570,7 +1571,7 @@ def observation_spec_unbatched(self, spec: Composite):
15701571
@property
15711572
def full_reward_spec_unbatched(self) -> Composite:
15721573
"""Returns the reward spec of the env as if it had no batch dimensions."""
1573-
return self._make_single_env_spec(self.full_action_spec)
1574+
return self._make_single_env_spec(self.full_reward_spec)
15741575

15751576
@full_reward_spec_unbatched.setter
15761577
def full_reward_spec_unbatched(self, spec: Composite):
@@ -1590,7 +1591,7 @@ def reward_spec_unbatched(self, spec: Composite):
15901591
@property
15911592
def full_done_spec_unbatched(self) -> Composite:
15921593
"""Returns the done spec of the env as if it had no batch dimensions."""
1593-
return self._make_single_env_spec(self.full_action_spec)
1594+
return self._make_single_env_spec(self.full_done_spec)
15941595

15951596
@full_done_spec_unbatched.setter
15961597
def full_done_spec_unbatched(self, spec: Composite):

0 commit comments

Comments
 (0)