Skip to content

Commit a94883f

Browse files
committed
Wrap unique_values call in xp.asarray
1 parent 4492a6f commit a94883f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/array_api_extra/_lib/_funcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,4 +749,4 @@ def union1d(a: Array, b: Array, /, *, xp: ModuleType) -> Array:
749749
"""See docstring in `array_api_extra._delegation.py`."""
750750
a = xp.reshape(a, (-1,))
751751
b = xp.reshape(b, (-1,))
752-
return xp.unique_values(xp.concat([a, b]))
752+
return xp.asarray(xp.unique_values(xp.concat([a, b])))

tests/test_funcs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,6 @@ def test_kind(self, xp: ModuleType, library: Backend):
16401640
xp_assert_equal(res, expected)
16411641

16421642

1643-
@pytest.mark.skip_xp_backend(Backend.SPARSE, reason="unique_values returns arrays")
16441643
@pytest.mark.skip_xp_backend(
16451644
Backend.ARRAY_API_STRICTEST,
16461645
reason="data_dependent_shapes flag for unique_values is disabled",

0 commit comments

Comments
 (0)