Skip to content

Commit

Permalink
Fix seeding issue with NormalizeObservation wrapper testing
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudo-rnd-thoughts committed Nov 7, 2023
1 parent 27f8e85 commit 0a099c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/wrappers/vector/test_normalize_observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ def test_against_wrapper(
vec_env = SyncVectorEnv([thunk for _ in range(n_envs)])
vec_env = wrappers.vector.NormalizeObservation(vec_env)

vec_env.reset()
vec_env.reset(seed=123)
vec_env.action_space.seed(123)
for _ in range(n_steps):
vec_env.step(vec_env.action_space.sample())

env = wrappers.Autoreset(thunk())
env = wrappers.NormalizeObservation(env)
env.reset()
env.reset(seed=123)
env.action_space.seed(123)
for _ in range(n_envs * n_steps):
env.step(env.action_space.sample())

Expand Down

0 comments on commit 0a099c8

Please sign in to comment.