Skip to content

Commit 23dbe91

Browse files
committed
Follow up fix implemented in gh-2530
1 parent 66b9b3b commit 23dbe91

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

dpnp/dpnp_iface_manipulation.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4270,7 +4270,13 @@ def unique(
42704270
42714271
"""
42724272

4273-
if axis is None or (axis == 0 and ar.ndim == 1):
4273+
dpnp.check_supported_arrays_type(ar)
4274+
nd = ar.ndim
4275+
4276+
if axis is None or nd == 1:
4277+
if axis is not None:
4278+
normalize_axis_index(axis, nd)
4279+
42744280
return _unique_1d(
42754281
ar, return_index, return_inverse, return_counts, equal_nan
42764282
)
@@ -4280,7 +4286,7 @@ def unique(
42804286
ar = dpnp.moveaxis(ar, axis, 0)
42814287
except AxisError:
42824288
# this removes the "axis1" or "axis2" prefix from the error message
4283-
raise AxisError(axis, ar.ndim) from None
4289+
raise AxisError(axis, nd) from None
42844290

42854291
# reshape input array into a contiguous 2D array
42864292
orig_sh = ar.shape

0 commit comments

Comments
 (0)