Skip to content

Commit 58ec0cd

Browse files
committed
Fix the array API unique() function
Original NumPy Commit: 4063752757a97c444b8913947a0890f2c2387bca
1 parent 74e0b22 commit 58ec0cd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

array_api_strict/_set_functions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ def unique(x: Array, /, *, return_counts: bool = False, return_index: bool = Fal
1212
1313
See its docstring for more information.
1414
"""
15-
return Array._new(np.unique(x._array, return_counts=return_counts, return_index=return_index, return_inverse=return_inverse))
15+
res = np.unique(x._array, return_counts=return_counts,
16+
return_index=return_index, return_inverse=return_inverse)
17+
if isinstance(res, tuple):
18+
return tuple(Array._new(i) for i in res)
19+
return Array._new(res)

0 commit comments

Comments
 (0)