Skip to content

Commit

Permalink
Fix some small bugs in gymnasium.vector (#1112)
Browse files Browse the repository at this point in the history
Co-authored-by: leoxhwang <[email protected]>
  • Loading branch information
xihuai18 and leoxhwang authored Jul 16, 2024
1 parent 1878f6d commit a01d94d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gymnasium/vector/async_vector_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ def _async_worker(
env_fn: callable,
pipe: Connection,
parent_pipe: Connection,
shared_memory: bool,
shared_memory: multiprocessing.Array | dict[str, Any] | tuple[Any, ...],
error_queue: Queue,
):
env = env_fn()
Expand Down Expand Up @@ -699,7 +699,7 @@ def _async_worker(
break
elif command == "_call":
name, args, kwargs = data
if name in ["reset", "step", "close", "set_wrapper_attr"]:
if name in ["reset", "step", "close", "_setattr", "_check_spaces"]:
raise ValueError(
f"Trying to call function `{name}` with `call`, use `{name}` directly instead."
)
Expand Down
2 changes: 2 additions & 0 deletions gymnasium/vector/sync_vector_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def reset(
self.single_observation_space, observations, self._observations
)

self._autoreset_envs = np.zeros((self.num_envs,), dtype=np.bool_)

return deepcopy(self._observations) if self.copy else self._observations, infos

def step(
Expand Down

0 comments on commit a01d94d

Please sign in to comment.