Skip to content

Commit

Permalink
fix action repeat wrapper (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
vint-1 authored Jun 14, 2023
1 parent 423291a commit 8fa35f8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions dreamerv3/embodied/core/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ class ActionRepeat(base.Wrapper):
def __init__(self, env, repeat):
super().__init__(env)
self._repeat = repeat
self._done = False

def step(self, action):
if action['reset'] or self._done:
if action['reset']:
return self.env.step(action)
reward = 0.0
for _ in range(self._repeat):
Expand All @@ -53,7 +52,6 @@ def step(self, action):
if obs['is_last'] or obs['is_terminal']:
break
obs['reward'] = np.float32(reward)
self._done = obs['is_last']
return obs


Expand Down

0 comments on commit 8fa35f8

Please sign in to comment.