mirror of
https://github.com/wassname/ray.git
synced 2026-07-01 16:54:21 +08:00
Fix FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result. (#6568)
This commit is contained in:
committed by
Robert Nishihara
parent
7bbfa85c66
commit
50fb26de68
@@ -47,7 +47,8 @@ def hstack(*xs):
|
||||
# TODO(rkn): Be consistent about using "index" versus "indices".
|
||||
@ray.remote
|
||||
def subarray(a, lower_indices, upper_indices):
|
||||
return a[[slice(l, u) for (l, u) in zip(lower_indices, upper_indices)]]
|
||||
idx = tuple(slice(l, u) for (l, u) in zip(lower_indices, upper_indices))
|
||||
return a[idx]
|
||||
|
||||
|
||||
@ray.remote
|
||||
|
||||
Reference in New Issue
Block a user