Download lib/python3.12/site-packages/numpy/array_api/tests/test_indexing_functions.py from parallel-reasoner/env-full: direct link, hf CLI and curl.
- Browser
- Download file 627 Bytes
-
https://huggingface.co/parallel-reasoner/env-full/resolve/b9918be14658eb32f7f27abe8daee683afea2901/lib/python3.12/site-packages/numpy/array_api/tests/test_indexing_functions.py
- Command line
-
hf download hf://parallel-reasoner/env-full@b9918be14658eb32f7f27abe8daee683afea2901/lib/python3.12/site-packages/numpy/array_api/tests/test_indexing_functions.py
-
curl -L -o test_indexing_functions.py https://huggingface.co/parallel-reasoner/env-full/resolve/b9918be14658eb32f7f27abe8daee683afea2901/lib/python3.12/site-packages/numpy/array_api/tests/test_indexing_functions.py
627 Bytes
| import pytest | |
| from numpy import array_api as xp | |
| def test_take_function(x, indices, axis, expected): | |
| """ | |
| Indices respect relative order of a descending stable-sort | |
| See https://github.com/numpy/numpy/issues/20778 | |
| """ | |
| x = xp.asarray(x) | |
| indices = xp.asarray(indices) | |
| out = xp.take(x, indices, axis=axis) | |
| assert xp.all(out == xp.asarray(expected)) | |