Skip to content

Commit

Permalink
Standardize sb3 vec env wrapper to match DummyVecEnv reset() function (
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottower authored Jul 20, 2023
2 parents 19e2fd0 + 47c2316 commit e27b0e1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion supersuit/vector/sb3_vector_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ def __init__(self, venv):
self.num_envs = venv.num_envs
self.observation_space = venv.observation_space
self.action_space = venv.action_space
self.reset_infos = []

def reset(self, seed=None, options=None):
if seed is not None:
self.seed(seed=seed)
return self.venv.reset()
# Note: SB3's vector envs return only observations on reset, and store infos in `self.reset_infos`
observations, self.reset_infos = self.venv.reset()
return observations

def step_wait(self):
observations, rewards, terminations, truncations, infos = self.venv.step_wait()
Expand Down

0 comments on commit e27b0e1

Please sign in to comment.