Skip to content

Commit

Permalink
Starting to reassign waiting_step in shmem_vecenv (openai#915)
Browse files Browse the repository at this point in the history
"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.
  • Loading branch information
elzino authored and pzhokhov committed May 31, 2019
1 parent 7614b02 commit ff8d36a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions baselines/common/vec_env/shmem_vec_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ def step_async(self, actions):
assert len(actions) == len(self.parent_pipes)
for pipe, act in zip(self.parent_pipes, actions):
pipe.send(('step', act))
self.waiting_step = True

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

Expand Down

0 comments on commit ff8d36a

Please sign in to comment.