Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.21.103.8
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_set_functions.py
import pytest
from hypothesis import given
from hypothesis.extra.array_api import make_strategies_namespace

from numpy import array_api as xp

xps = make_strategies_namespace(xp)


@pytest.mark.parametrize("func", [xp.unique_all, xp.unique_inverse])
@given(xps.arrays(dtype=xps.scalar_dtypes(), shape=xps.array_shapes()))
def test_inverse_indices_shape(func, x):
    """
    Inverse indices share shape of input array

    See https://github.com/numpy/numpy/issues/20638
    """
    out = func(x)
    assert out.inverse_indices.shape == x.shape
© 2025 GrazzMean