Skip to content

Commit

Permalink
[rllib] arr[end] was excluded when end is not None (ray-project#1931)
Browse files Browse the repository at this point in the history
Looks good, thanks!
  • Loading branch information
royf authored and ericl committed Apr 22, 2018
1 parent 8f59546 commit baf97e4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions python/ray/rllib/optimizers/segment_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ def reduce(self, start=0, end=None):
elements.
"""
if end is None:
end = self._capacity
end = self._capacity - 1
if end < 0:
end += self._capacity
end -= 1
return self._reduce_helper(start, end, 1, 0, self._capacity - 1)

def __setitem__(self, idx, val):
Expand Down

0 comments on commit baf97e4

Please sign in to comment.