@@ -110,7 +110,7 @@ def test_unique_all(x):
110
110
vals_idx [val ] = idx
111
111
112
112
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
114
114
expected = sum (v for k , v in counts .items () if math .isnan (k ))
115
115
assert nans == expected , f"{ nans } NaNs in out, but should be { expected } "
116
116
@@ -157,7 +157,7 @@ def test_unique_counts(x):
157
157
), f"out[{ idx } ]={ val } , but { val } is also in out[{ vals_idx [val ]} ]"
158
158
vals_idx [val ] = idx
159
159
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
161
161
expected = sum (v for k , v in counts .items () if math .isnan (k ))
162
162
assert nans == expected , f"{ nans } NaNs in out, but should be { expected } "
163
163
@@ -210,7 +210,7 @@ def test_unique_inverse(x):
210
210
else :
211
211
assert val == expected , msg
212
212
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
214
214
expected = xp .sum (xp .astype (xp .isnan (x ), xp .uint8 ))
215
215
assert nans == expected , f"{ nans } NaNs in out.values, but should be { expected } "
216
216
@@ -234,6 +234,6 @@ def test_unique_values(x):
234
234
), f"out[{ idx } ]={ val } , but { val } is also in out[{ vals_idx [val ]} ]"
235
235
vals_idx [val ] = idx
236
236
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
238
238
expected = xp .sum (xp .astype (xp .isnan (x ), xp .uint8 ))
239
239
assert nans == expected , f"{ nans } NaNs in out, but should be { expected } "
0 commit comments