Dask added an additional keyword-only argument ``method``. method : {'sequential', 'blelloch'}, optional Choose which method to use to perform the cumsum. Default is 'sequential'. * 'sequential' performs the cumsum of each prior block before the current block. * 'blell
(x, axis=None, dtype=None, out=None, method="sequential")
| 1274 | |
| 1275 | @derived_from(np) |
| 1276 | def cumsum(x, axis=None, dtype=None, out=None, method="sequential"): |
| 1277 | """Dask added an additional keyword-only argument ``method``. |
| 1278 | |
| 1279 | method : {'sequential', 'blelloch'}, optional |
| 1280 | Choose which method to use to perform the cumsum. Default is 'sequential'. |
| 1281 | |
| 1282 | * 'sequential' performs the cumsum of each prior block before the current block. |
| 1283 | * 'blelloch' is a work-efficient parallel cumsum. It exposes parallelism by |
| 1284 | first taking the sum of each block and combines the sums via a binary tree. |
| 1285 | This method may be faster or more memory efficient depending on workload, |
| 1286 | scheduler, and hardware. More benchmarking is necessary. |
| 1287 | """ |
| 1288 | return cumreduction( |
| 1289 | np.cumsum, |
| 1290 | _cumsum_merge, |
| 1291 | 0, |
| 1292 | x, |
| 1293 | axis, |
| 1294 | dtype, |
| 1295 | out=out, |
| 1296 | method=method, |
| 1297 | preop=np.sum, |
| 1298 | ) |
| 1299 | |
| 1300 | |
| 1301 | @derived_from(np) |