def step(self, actions):
    """Step."""
    self._elapsed_steps += 1
    obs, rewards, dones = \
        [np.array(r) for r in self.batch_env.step(actions)]
    if self._elapsed_steps > self._max_episode_steps:
      done = True
      if self._elapsed_steps > self._max_episode_steps + 1:
        rewards.fill(0)
    else:
      done = dones[0]
      assert np.all(done == dones), ("Current modifications of Dopamine "
                                     "require same number of steps for each "
                                     "environment in batch")
      del dones

    self.game_over = done
    return obs, rewards, done, {}
Step.