Skip to content

Commit a91d82c

Browse files
committed
documentation nit
1 parent 1954a15 commit a91d82c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: src/array_api_extra/_lib/_funcs.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -713,13 +713,14 @@ def nunique(x: Array, /, *, xp: ModuleType | None = None) -> Array:
713713

714714
# There are 3 general use cases:
715715
# 1. backend has unique_counts and it returns an array with known shape
716-
# 2. backend has unique_counts and it returns a None-shaped array
717-
# 3. backend does not have unique_counts
716+
# 2. backend has unique_counts and it returns a None-sized array;
717+
# e.g. Dask, ndonnx
718+
# 3. backend does not have unique_counts; e.g. wrapped JAX
718719
if capabilities(xp)["data-dependent shapes"]:
719720
# xp has unique_counts; O(n) complexity
720721
_, counts = xp.unique_counts(x)
721722
n = _compat.size(counts)
722-
if n is None: # e.g. Dask, ndonnx
723+
if n is None:
723724
return xp.sum(xp.ones_like(counts))
724725
return xp.asarray(n, device=_compat.device(x))
725726

0 commit comments

Comments
 (0)