Skip to content

Commit

Permalink
Merge pull request #205 from kywch/float-obs
Browse files Browse the repository at this point in the history
Changed obs dtype to float32 (from float64) to match the obs space definition
  • Loading branch information
Vittorio-Caggiano authored Aug 16, 2024
2 parents 3a245b1 + 9f53244 commit 3fe5c31
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions myosuite/envs/obs_vec_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ def obsdict2obsvec(self, obs_dict, ordered_obs_keys):
if not self.initialized:
self.initialize(obs_dict, ordered_obs_keys)

# recover vec
obsvec = np.zeros(0)
obs_list = [np.zeros(0)]
for key in self.ordered_obs_keys:
obsvec = np.concatenate([obsvec, obs_dict[key].ravel()]) # ravel helps with images
obs_list.append(obs_dict[key].ravel()) # ravel helps with images
obsvec = np.concatenate(obs_list, dtype=np.float32)

# cache
t = obs_dict['time']
Expand Down

0 comments on commit 3fe5c31

Please sign in to comment.