Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Fix robohive #2080

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
amend
  • Loading branch information
vmoens committed Apr 15, 2024
commit 116c7527c8a91acfd9adfc49def59266fcad1574
8 changes: 7 additions & 1 deletion torchrl/envs/libs/robohive.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,11 @@ def get_obs():
self.observation_spec.update(spec)
self.empty_cache()

def _reset_output_transform(self, reset_data):
if not (isinstance(reset_data, tuple) and len(reset_data) == 2):
return reset_data, {}
return reset_data

def set_from_pixels(self, from_pixels: bool) -> None:
"""Sets the from_pixels attribute to an existing environment.

Expand Down Expand Up @@ -362,7 +367,8 @@ def read_info(self, info, tensordict_out):
out = (
TensorDict(info, [])
.filter_non_tensor_data()
.exclude("obs_dict", "done", "reward", *self._env.obs_keys, "act").apply(lambda x: x, filter_empty=True)
.exclude("obs_dict", "done", "reward", *self._env.obs_keys, "act")
.apply(lambda x: x, filter_empty=True)
)
if "info" in self.observation_spec.keys():
info_spec = self.observation_spec["info"]
Expand Down
Loading