Skip to content

Commit ad55fea

Browse files
committed
MAINT: reshape does not accept int
1 parent 84b1f0b commit ad55fea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/array_api_extra/_lib/_funcs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,8 @@ def nunique(x: Array, /, *, xp: ModuleType | None = None) -> Array:
725725
return xp.asarray(n, device=_compat.device(x))
726726

727727
# xp does not have unique_counts; O(n*logn) complexity
728-
x = xp.sort(xp.reshape(x, -1))
728+
x = xp.reshape(x, (-1,))
729+
x = xp.sort(x)
729730
mask = x != xp.roll(x, -1)
730731
default_int = xp.__array_namespace_info__().default_dtypes(
731732
device=_compat.device(x)

0 commit comments

Comments
 (0)