def reset(self):
        """Clear buffer and re-fill by duplicating the first observation."""
        ob = self.env.reset()
        for _ in range(self.k - 1):
            self.frames.append(np.zeros_like(ob))
        self.frames.append(ob)
        return self.observation()
Clear buffer and re-fill by duplicating the first observation.
examples/A3C-Gym/atari_wrapper.py