Skip to content

Commit

Permalink
Minor fixes for the resize observation wrapper (openai#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
RedTachyon authored Jan 11, 2023
1 parent d1067f7 commit 8fd0740
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions gymnasium/wrappers/resize_observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ def __init__(self, env: gym.Env, shape: tuple[int, int] | int) -> None:
), f"Expected the observation space to be Box, actual type: {type(env.observation_space)}"
dims = len(env.observation_space.shape)
assert (
2 <= dims <= 3
dims == 2 or dims == 3
), f"Expected the observation space to have 2 or 3 dimensions, got: {dims}"

self.shape = tuple(shape)

obs_shape = self.shape + env.observation_space.shape[2:]
self.observation_space = Box(low=0, high=255, shape=obs_shape, dtype=np.uint8)

Expand Down

0 comments on commit 8fd0740

Please sign in to comment.