Commit 104f7a1
committed
Reject degenerate stochastic frameskip (n, n) at construction
The stochastic-frameskip validation in AtariEnv.__init__ only rejected
reversed bounds (frameskip[0] > frameskip[1]), so an equal-bounds tuple
such as (4, 4) passed validation. step() then calls
self.np_random.integers(*self._frameskip), and numpy's integers() samples
from the half-open interval [low, high); with low == high that range is
empty and raises "ValueError: low >= high". The result was that
construction and reset succeeded but the first step() died with a cryptic
numpy error unrelated on its face to the frameskip argument.
Tighten the check to frameskip[0] >= frameskip[1] so an empty range fails
fast at construction, and fix the copy-paste error in the lower-bound
message (it previously duplicated the bound-ordering text).1 parent 4642385 commit 104f7a1
2 files changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
| |||
0 commit comments