Skip to content

Commit baf97e4

Browse files
royfericl
authored andcommitted
[rllib] arr[end] was excluded when end is not None (#1931)
Looks good, thanks!
1 parent 8f59546 commit baf97e4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

python/ray/rllib/optimizers/segment_tree.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,9 @@ def reduce(self, start=0, end=None):
7878
elements.
7979
"""
8080
if end is None:
81-
end = self._capacity
81+
end = self._capacity - 1
8282
if end < 0:
8383
end += self._capacity
84-
end -= 1
8584
return self._reduce_helper(start, end, 1, 0, self._capacity - 1)
8685

8786
def __setitem__(self, idx, val):

0 commit comments

Comments
 (0)