Description
The Array API states:
An integer index must be an object satisfying operator.index (e.g., int).
Therefore, this is legal, because operator.index(np.int64(0))
works:
>>> import array_api_strict as xp
>>> import numpy as np
>>> a = xp.asarray([10, 20])
>>> a[np.int64(0)]
10
#139 broke it and caused a regression in scipy:
FAILED scipy/cluster/tests/test_vq.py::TestKMean::test_kmeans2_init[array_api_strict] - ValueError: Array indexing is only allowed when array to be indexed and all indexing arrays are on the same device.
FAILED scipy/cluster/tests/test_vq.py::TestKMean::test_kmeans2_kpp_low_dim[array_api_strict] - ValueError: Array indexing is only allowed when array to be indexed and all indexing arrays are on the same device.
FAILED scipy/cluster/tests/test_vq.py::TestKMean::test_kmeans2_kpp_high_dim[array_api_strict] - ValueError: Array indexing is only allowed when array to be indexed and all indexing arrays are on the same device.
FAILED scipy/cluster/tests/test_vq.py::TestKMean::test_kmeans_and_kmeans2_random_seed[array_api_strict] - ValueError: Array indexing is only allowed when array to be indexed and all indexing arrays are on the same device.
CC @lucyleeow
Metadata
Metadata
Assignees
Labels
No labels