Skip to content

Commit 59cfd99

Browse files
danielsuoFlax Authors
authored andcommitted
[flax:examples:ppo] Fix some linter / import issues. #jax-fixit
PiperOrigin-RevId: 839488572
1 parent 5a3d148 commit 59cfd99

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/ppo/seed_rl_atari_preprocessing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"""
3232

3333
import cv2
34-
from gymnasium.spaces.box import Box
3534
import gymnasium as gym
35+
from gymnasium.spaces.box import Box
3636
import numpy as np
3737

3838

@@ -117,7 +117,7 @@ def action_space(self):
117117

118118
@property
119119
def reward_range(self):
120-
return self.environment.reward_range
120+
return self.environment.reward_range # type: ignore
121121

122122
@property
123123
def metadata(self):
@@ -189,7 +189,7 @@ def step(self, action):
189189
# We bypass the Gym observation altogether and directly fetch the
190190
# grayscale image from the ALE. This is a little faster.
191191
_, reward, game_over, _, info = self.environment.step(action)
192-
accumulated_reward += reward
192+
accumulated_reward += float(reward)
193193

194194
if self.terminal_on_life_loss:
195195
new_lives = self.environment.unwrapped.ale.lives() # pytype:disable=attribute-error

0 commit comments

Comments
 (0)