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.
This commit is contained in:
Jinho Lee
2019-06-01 06:31:35 +09:00
committed by pzhokhov
parent 7614b02f7a
commit ff8d36a7a7

View File

@@ -70,9 +70,11 @@ class ShmemVecEnv(VecEnv):
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