Unverified Commit 5105ce71 authored by ashaw596's avatar ashaw596 Committed by GitHub
Browse files

Fix bug in gym_wrapper.

Added an 'env' parameter to env_step function since one an unreferenced one is used in the function.
parent aeb8cfcb
......@@ -92,14 +92,14 @@ class GymWrapper(object):
def step(self, actions):
def env_step(action):
def env_step(env, action):
action = self.env_spec.convert_action_to_gym(action)
obs, reward, done, tt = env.step(action)
obs = self.env_spec.convert_obs_to_list(obs)
return obs, reward, done, tt
actions = zip(*actions)
outputs = [env_step(action)
outputs = [env_step(env, action)
if not done else (self.env_spec.initial_obs(None), 0, True, None)
for action, env, done in zip(actions, self.envs, self.dones)]
for i, (_, _, done, _) in enumerate(outputs):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment