@@ -110,7 +110,7 @@ def test_unique_all(x):
110110 vals_idx [val ] = idx
111111
112112 if dh .is_float_dtype (out .values .dtype ):
113- assume (x . size <= 128 ) # may not be representable
113+ assume (math . prod ( x . shape ) <= 128 ) # may not be representable
114114 expected = sum (v for k , v in counts .items () if math .isnan (k ))
115115 assert nans == expected , f"{ nans } NaNs in out, but should be { expected } "
116116
@@ -157,7 +157,7 @@ def test_unique_counts(x):
157157 ), f"out[{ idx } ]={ val } , but { val } is also in out[{ vals_idx [val ]} ]"
158158 vals_idx [val ] = idx
159159 if dh .is_float_dtype (out .values .dtype ):
160- assume (x . size <= 128 ) # may not be representable
160+ assume (math . prod ( x . shape ) <= 128 ) # may not be representable
161161 expected = sum (v for k , v in counts .items () if math .isnan (k ))
162162 assert nans == expected , f"{ nans } NaNs in out, but should be { expected } "
163163
@@ -210,7 +210,7 @@ def test_unique_inverse(x):
210210 else :
211211 assert val == expected , msg
212212 if dh .is_float_dtype (out .values .dtype ):
213- assume (x . size <= 128 ) # may not be representable
213+ assume (math . prod ( x . shape ) <= 128 ) # may not be representable
214214 expected = xp .sum (xp .astype (xp .isnan (x ), xp .uint8 ))
215215 assert nans == expected , f"{ nans } NaNs in out.values, but should be { expected } "
216216
@@ -234,6 +234,6 @@ def test_unique_values(x):
234234 ), f"out[{ idx } ]={ val } , but { val } is also in out[{ vals_idx [val ]} ]"
235235 vals_idx [val ] = idx
236236 if dh .is_float_dtype (out .dtype ):
237- assume (x . size <= 128 ) # may not be representable
237+ assume (math . prod ( x . shape ) <= 128 ) # may not be representable
238238 expected = xp .sum (xp .astype (xp .isnan (x ), xp .uint8 ))
239239 assert nans == expected , f"{ nans } NaNs in out, but should be { expected } "
0 commit comments