@@ -228,8 +228,8 @@ def __repr__(self):
228
228
combine = "sum" ,
229
229
fill_value = 0 ,
230
230
final_fill_value = 0 ,
231
- dtypes = np .intp ,
232
- final_dtype = np .intp ,
231
+ dtypes = np .uintp ,
232
+ final_dtype = np .uintp ,
233
233
)
234
234
235
235
# note that the fill values are the result of np.func([np.nan, np.nan])
@@ -250,7 +250,7 @@ def __repr__(self):
250
250
combine = ("sum" , "sum" ),
251
251
finalize = lambda sum_ , count : sum_ / count ,
252
252
fill_value = (0 , 0 ),
253
- dtypes = (None , np .intp ),
253
+ dtypes = (None , np .uintp ),
254
254
final_dtype = np .floating ,
255
255
)
256
256
nanmean = Aggregation (
@@ -259,7 +259,7 @@ def __repr__(self):
259
259
combine = ("sum" , "sum" ),
260
260
finalize = lambda sum_ , count : sum_ / count ,
261
261
fill_value = (0 , 0 ),
262
- dtypes = (None , np .intp ),
262
+ dtypes = (None , np .uintp ),
263
263
final_dtype = np .floating ,
264
264
)
265
265
@@ -283,7 +283,7 @@ def _std_finalize(sumsq, sum_, count, ddof=0):
283
283
finalize = _var_finalize ,
284
284
fill_value = 0 ,
285
285
final_fill_value = np .nan ,
286
- dtypes = (None , None , np .intp ),
286
+ dtypes = (None , None , np .uintp ),
287
287
final_dtype = np .floating ,
288
288
)
289
289
nanvar = Aggregation (
@@ -293,7 +293,7 @@ def _std_finalize(sumsq, sum_, count, ddof=0):
293
293
finalize = _var_finalize ,
294
294
fill_value = 0 ,
295
295
final_fill_value = np .nan ,
296
- dtypes = (None , None , np .intp ),
296
+ dtypes = (None , None , np .uintp ),
297
297
final_dtype = np .floating ,
298
298
)
299
299
std = Aggregation (
@@ -303,7 +303,7 @@ def _std_finalize(sumsq, sum_, count, ddof=0):
303
303
finalize = _std_finalize ,
304
304
fill_value = 0 ,
305
305
final_fill_value = np .nan ,
306
- dtypes = (None , None , np .intp ),
306
+ dtypes = (None , None , np .uintp ),
307
307
final_dtype = np .floating ,
308
308
)
309
309
nanstd = Aggregation (
@@ -313,7 +313,7 @@ def _std_finalize(sumsq, sum_, count, ddof=0):
313
313
finalize = _std_finalize ,
314
314
fill_value = 0 ,
315
315
final_fill_value = np .nan ,
316
- dtypes = (None , None , np .intp ),
316
+ dtypes = (None , None , np .uintp ),
317
317
final_dtype = np .floating ,
318
318
)
319
319
@@ -336,7 +336,7 @@ def argreduce_preprocess(array, axis):
336
336
assert len (axis ) == 1
337
337
axis = axis [0 ]
338
338
339
- idx = dask .array .arange (array .shape [axis ], chunks = array .chunks [axis ], dtype = np .intp )
339
+ idx = dask .array .arange (array .shape [axis ], chunks = array .chunks [axis ], dtype = np .uintp )
340
340
# broadcast (TODO: is this needed?)
341
341
idx = idx [tuple (slice (None ) if i == axis else np .newaxis for i in range (array .ndim ))]
342
342
@@ -362,8 +362,8 @@ def _zip_index(array_, idx_):
362
362
fill_value = (dtypes .NINF , 0 ),
363
363
final_fill_value = - 1 ,
364
364
finalize = lambda * x : x [1 ],
365
- dtypes = (None , np .intp ),
366
- final_dtype = np .intp ,
365
+ dtypes = (None , np .uintp ),
366
+ final_dtype = np .uintp ,
367
367
)
368
368
369
369
argmin = Aggregation (
@@ -375,8 +375,8 @@ def _zip_index(array_, idx_):
375
375
fill_value = (dtypes .INF , 0 ),
376
376
final_fill_value = - 1 ,
377
377
finalize = lambda * x : x [1 ],
378
- dtypes = (None , np .intp ),
379
- final_dtype = np .intp ,
378
+ dtypes = (None , np .uintp ),
379
+ final_dtype = np .uintp ,
380
380
)
381
381
382
382
nanargmax = Aggregation (
@@ -388,8 +388,8 @@ def _zip_index(array_, idx_):
388
388
fill_value = (dtypes .NINF , - 1 ),
389
389
final_fill_value = - 1 ,
390
390
finalize = lambda * x : x [1 ],
391
- dtypes = (None , np .intp ),
392
- final_dtype = np .intp ,
391
+ dtypes = (None , np .uintp ),
392
+ final_dtype = np .uintp ,
393
393
)
394
394
395
395
nanargmin = Aggregation (
@@ -401,8 +401,8 @@ def _zip_index(array_, idx_):
401
401
fill_value = (dtypes .INF , - 1 ),
402
402
final_fill_value = - 1 ,
403
403
finalize = lambda * x : x [1 ],
404
- dtypes = (None , np .intp ),
405
- final_dtype = np .intp ,
404
+ dtypes = (None , np .uintp ),
405
+ final_dtype = np .uintp ,
406
406
)
407
407
408
408
first = Aggregation ("first" , chunk = None , combine = None , fill_value = 0 )
@@ -520,7 +520,9 @@ def _initialize_aggregation(
520
520
agg .combine += ("sum" ,)
521
521
agg .fill_value ["intermediate" ] += (0 ,)
522
522
agg .fill_value ["numpy" ] += (0 ,)
523
- agg .dtype ["intermediate" ] += (np .intp ,)
524
- agg .dtype ["numpy" ] += (np .intp ,)
523
+ # uintp is supported by cupy, intp is not
524
+ # Also count is >=0, so uint should be fine.
525
+ agg .dtype ["intermediate" ] += (np .uintp ,)
526
+ agg .dtype ["numpy" ] += (np .uintp ,)
525
527
526
528
return agg
0 commit comments