Skip to content

Commit a01d94d

Browse files
xihuai18leoxhwang
and
leoxhwang
authored
Fix some small bugs in gymnasium.vector (#1112)
Co-authored-by: leoxhwang <[email protected]>
1 parent 1878f6d commit a01d94d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

gymnasium/vector/async_vector_env.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ def _async_worker(
650650
env_fn: callable,
651651
pipe: Connection,
652652
parent_pipe: Connection,
653-
shared_memory: bool,
653+
shared_memory: multiprocessing.Array | dict[str, Any] | tuple[Any, ...],
654654
error_queue: Queue,
655655
):
656656
env = env_fn()
@@ -699,7 +699,7 @@ def _async_worker(
699699
break
700700
elif command == "_call":
701701
name, args, kwargs = data
702-
if name in ["reset", "step", "close", "set_wrapper_attr"]:
702+
if name in ["reset", "step", "close", "_setattr", "_check_spaces"]:
703703
raise ValueError(
704704
f"Trying to call function `{name}` with `call`, use `{name}` directly instead."
705705
)

gymnasium/vector/sync_vector_env.py

+2
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ def reset(
152152
self.single_observation_space, observations, self._observations
153153
)
154154

155+
self._autoreset_envs = np.zeros((self.num_envs,), dtype=np.bool_)
156+
155157
return deepcopy(self._observations) if self.copy else self._observations, infos
156158

157159
def step(

0 commit comments

Comments
 (0)