Skip to content

Commit ff8d36a

Browse files
elzinopzhokhov
authored andcommitted
Starting to reassign waiting_step in shmem_vecenv (#915)
"self.waiting_step" is initialized in __init__ function but it is not reassigned anywhere. Because it is used in reset function and close_extras function, it should be fixed. So i fixed it to be similar with subproc_vec_env's one.
1 parent 7614b02 commit ff8d36a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

baselines/common/vec_env/shmem_vec_env.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ def step_async(self, actions):
7070
assert len(actions) == len(self.parent_pipes)
7171
for pipe, act in zip(self.parent_pipes, actions):
7272
pipe.send(('step', act))
73+
self.waiting_step = True
7374

7475
def step_wait(self):
7576
outs = [pipe.recv() for pipe in self.parent_pipes]
77+
self.waiting_step = False
7678
obs, rews, dones, infos = zip(*outs)
7779
return self._decode_obses(obs), np.array(rews), np.array(dones), infos
7880

0 commit comments

Comments
 (0)