MCPcopy Create free account
hub / github.com/dask/dask / cumsum

Function cumsum

dask/array/reductions.py:1294–1316  ·  view source on GitHub ↗

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")

Source from the content-addressed store, hash-verified

1292
1293@derived_from(np)
1294def cumsum(x, axis=None, dtype=None, out=None, method="sequential"):
1295 """Dask added an additional keyword-only argument ``method``.
1296
1297 method : {'sequential', 'blelloch'}, optional
1298 Choose which method to use to perform the cumsum. Default is 'sequential'.
1299
1300 * 'sequential' performs the cumsum of each prior block before the current block.
1301 * 'blelloch' is a work-efficient parallel cumsum. It exposes parallelism by
1302 first taking the sum of each block and combines the sums via a binary tree.
1303 This method may be faster or more memory efficient depending on workload,
1304 scheduler, and hardware. More benchmarking is necessary.
1305 """
1306 return cumreduction(
1307 np.cumsum,
1308 _cumsum_merge,
1309 0,
1310 x,
1311 axis,
1312 dtype,
1313 out=out,
1314 method=method,
1315 preop=np.sum,
1316 )
1317
1318
1319@derived_from(np)

Callers 1

cumsumMethod · 0.90

Calls 1

cumreductionFunction · 0.85

Tested by

no test coverage detected