@@ -252,8 +252,8 @@ def __repr__(self) -> str:
252
252
combine = "sum" ,
253
253
fill_value = 0 ,
254
254
final_fill_value = 0 ,
255
- dtypes = np .intp ,
256
- final_dtype = np .intp ,
255
+ dtypes = np .uintp ,
256
+ final_dtype = np .uintp ,
257
257
)
258
258
259
259
# note that the fill values are the result of np.func([np.nan, np.nan])
@@ -281,7 +281,7 @@ def _mean_finalize(sum_, count):
281
281
combine = ("sum" , "sum" ),
282
282
finalize = _mean_finalize ,
283
283
fill_value = (0 , 0 ),
284
- dtypes = (None , np .intp ),
284
+ dtypes = (None , np .uintp ),
285
285
final_dtype = np .floating ,
286
286
)
287
287
nanmean = Aggregation (
@@ -290,7 +290,7 @@ def _mean_finalize(sum_, count):
290
290
combine = ("sum" , "sum" ),
291
291
finalize = _mean_finalize ,
292
292
fill_value = (0 , 0 ),
293
- dtypes = (None , np .intp ),
293
+ dtypes = (None , np .uintp ),
294
294
final_dtype = np .floating ,
295
295
)
296
296
@@ -315,7 +315,7 @@ def _std_finalize(sumsq, sum_, count, ddof=0):
315
315
finalize = _var_finalize ,
316
316
fill_value = 0 ,
317
317
final_fill_value = np .nan ,
318
- dtypes = (None , None , np .intp ),
318
+ dtypes = (None , None , np .uintp ),
319
319
final_dtype = np .floating ,
320
320
)
321
321
nanvar = Aggregation (
@@ -325,7 +325,7 @@ def _std_finalize(sumsq, sum_, count, ddof=0):
325
325
finalize = _var_finalize ,
326
326
fill_value = 0 ,
327
327
final_fill_value = np .nan ,
328
- dtypes = (None , None , np .intp ),
328
+ dtypes = (None , None , np .uintp ),
329
329
final_dtype = np .floating ,
330
330
)
331
331
std = Aggregation (
@@ -335,7 +335,7 @@ def _std_finalize(sumsq, sum_, count, ddof=0):
335
335
finalize = _std_finalize ,
336
336
fill_value = 0 ,
337
337
final_fill_value = np .nan ,
338
- dtypes = (None , None , np .intp ),
338
+ dtypes = (None , None , np .uintp ),
339
339
final_dtype = np .floating ,
340
340
)
341
341
nanstd = Aggregation (
@@ -345,7 +345,7 @@ def _std_finalize(sumsq, sum_, count, ddof=0):
345
345
finalize = _std_finalize ,
346
346
fill_value = 0 ,
347
347
final_fill_value = np .nan ,
348
- dtypes = (None , None , np .intp ),
348
+ dtypes = (None , None , np .uintp ),
349
349
final_dtype = np .floating ,
350
350
)
351
351
@@ -368,7 +368,7 @@ def argreduce_preprocess(array, axis):
368
368
assert len (axis ) == 1
369
369
axis = axis [0 ]
370
370
371
- idx = dask .array .arange (array .shape [axis ], chunks = array .chunks [axis ], dtype = np .intp )
371
+ idx = dask .array .arange (array .shape [axis ], chunks = array .chunks [axis ], dtype = np .uintp )
372
372
# broadcast (TODO: is this needed?)
373
373
idx = idx [tuple (slice (None ) if i == axis else np .newaxis for i in range (array .ndim ))]
374
374
@@ -398,8 +398,8 @@ def _pick_second(*x):
398
398
fill_value = (dtypes .NINF , 0 ),
399
399
final_fill_value = - 1 ,
400
400
finalize = _pick_second ,
401
- dtypes = (None , np .intp ),
402
- final_dtype = np .intp ,
401
+ dtypes = (None , np .uintp ),
402
+ final_dtype = np .uintp ,
403
403
)
404
404
405
405
argmin = Aggregation (
@@ -411,8 +411,8 @@ def _pick_second(*x):
411
411
fill_value = (dtypes .INF , 0 ),
412
412
final_fill_value = - 1 ,
413
413
finalize = _pick_second ,
414
- dtypes = (None , np .intp ),
415
- final_dtype = np .intp ,
414
+ dtypes = (None , np .uintp ),
415
+ final_dtype = np .uintp ,
416
416
)
417
417
418
418
nanargmax = Aggregation (
@@ -424,8 +424,8 @@ def _pick_second(*x):
424
424
fill_value = (dtypes .NINF , 0 ),
425
425
final_fill_value = - 1 ,
426
426
finalize = _pick_second ,
427
- dtypes = (None , np .intp ),
428
- final_dtype = np .intp ,
427
+ dtypes = (None , np .uintp ),
428
+ final_dtype = np .uintp ,
429
429
)
430
430
431
431
nanargmin = Aggregation (
@@ -437,8 +437,8 @@ def _pick_second(*x):
437
437
fill_value = (dtypes .INF , 0 ),
438
438
final_fill_value = - 1 ,
439
439
finalize = _pick_second ,
440
- dtypes = (None , np .intp ),
441
- final_dtype = np .intp ,
440
+ dtypes = (None , np .uintp ),
441
+ final_dtype = np .uintp ,
442
442
)
443
443
444
444
first = Aggregation ("first" , chunk = None , combine = None , fill_value = 0 )
@@ -574,8 +574,10 @@ def _initialize_aggregation(
574
574
agg .combine += ("sum" ,)
575
575
agg .fill_value ["intermediate" ] += (0 ,)
576
576
agg .fill_value ["numpy" ] += (0 ,)
577
- agg .dtype ["intermediate" ] += (np .intp ,)
578
- agg .dtype ["numpy" ] += (np .intp ,)
577
+ # uintp is supported by cupy, intp is not
578
+ # Also count is >=0, so uint should be fine.
579
+ agg .dtype ["intermediate" ] += (np .uintp ,)
580
+ agg .dtype ["numpy" ] += (np .uintp ,)
579
581
else :
580
582
agg .min_count = 0
581
583
0 commit comments