Dask added an additional keyword-only argument ``method``. method : {'sequential', 'blelloch'}, optional Choose which method to use to perform the cumprod. Default is 'sequential'. * 'sequential' performs the cumprod of each prior block before the current block. * 'ble
(x, axis=None, dtype=None, out=None, method="sequential")
| 1300 | |
| 1301 | @derived_from(np) |
| 1302 | def cumprod(x, axis=None, dtype=None, out=None, method="sequential"): |
| 1303 | """Dask added an additional keyword-only argument ``method``. |
| 1304 | |
| 1305 | method : {'sequential', 'blelloch'}, optional |
| 1306 | Choose which method to use to perform the cumprod. Default is 'sequential'. |
| 1307 | |
| 1308 | * 'sequential' performs the cumprod of each prior block before the current block. |
| 1309 | * 'blelloch' is a work-efficient parallel cumprod. It exposes parallelism by first |
| 1310 | taking the product of each block and combines the products via a binary tree. |
| 1311 | This method may be faster or more memory efficient depending on workload, |
| 1312 | scheduler, and hardware. More benchmarking is necessary. |
| 1313 | """ |
| 1314 | return cumreduction( |
| 1315 | np.cumprod, |
| 1316 | _cumprod_merge, |
| 1317 | 1, |
| 1318 | x, |
| 1319 | axis, |
| 1320 | dtype, |
| 1321 | out=out, |
| 1322 | method=method, |
| 1323 | preop=np.prod, |
| 1324 | ) |
| 1325 | |
| 1326 | |
| 1327 | def topk(a, k, axis=-1, split_every=None): |