8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
array_api
1 parent 8b967ff commit ccc1091Copy full SHA for ccc1091
numpy/array_api/tests/test_set_functions.py
@@ -0,0 +1,19 @@
1
+import pytest
2
+from hypothesis import given
3
+from hypothesis.extra.array_api import make_strategies_namespace
4
+
5
+from numpy import array_api as xp
6
7
+xps = make_strategies_namespace(xp)
8
9
10
+@pytest.mark.parametrize("func", [xp.unique_all, xp.unique_inverse])
11
+@given(xps.arrays(dtype=xps.scalar_dtypes(), shape=xps.array_shapes()))
12
+def test_inverse_indices_shape(func, x):
13
+ """
14
+ Inverse indices share shape of input array
15
16
+ See https://github.com/numpy/numpy/issues/20638
17
18
+ out = func(x)
19
+ assert out.inverse_indices.shape == x.shape
0 commit comments