Skip to content

Commit e58c0cb

Browse files
authored
Merge pull request #294 from crusaderky/reshape
MAINT: `reshape` does not accept int
2 parents 0d6f12f + ad55fea commit e58c0cb

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)