$32 GRAYBYTE WORDPRESS FILE MANAGER $69

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/array_api/tests/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/array_api/tests//test_indexing_functions.py
import pytest

from numpy import array_api as xp


@pytest.mark.parametrize(
    "x, indices, axis, expected",
    [
        ([2, 3], [1, 1, 0], 0,  [3, 3, 2]),
        ([2, 3], [1, 1, 0], -1, [3, 3, 2]),
        ([[2, 3]], [1], -1, [[3]]),
        ([[2, 3]], [0, 0], 0, [[2, 3], [2, 3]]),
    ],
)
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))

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
14 Aug 2025 9.24 PM
root / root
0755
__pycache__
--
14 Aug 2025 9.24 PM
root / root
0755
__init__.py
0.275 KB
17 Apr 2025 8.10 PM
root / root
0644
test_array_object.py
16.636 KB
17 Apr 2025 8.10 PM
root / root
0644
test_creation_functions.py
4.905 KB
17 Apr 2025 8.10 PM
root / root
0644
test_data_type_functions.py
0.994 KB
17 Apr 2025 8.10 PM
root / root
0644
test_elementwise_functions.py
3.711 KB
17 Apr 2025 8.10 PM
root / root
0644
test_indexing_functions.py
0.612 KB
17 Apr 2025 8.10 PM
root / root
0644
test_manipulation_functions.py
1.062 KB
17 Apr 2025 8.10 PM
root / root
0644
test_set_functions.py
0.533 KB
17 Apr 2025 8.10 PM
root / root
0644
test_sorting_functions.py
0.588 KB
17 Apr 2025 8.10 PM
root / root
0644
test_validation.py
0.66 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF