dpnp.cumsum
- dpnp.cumsum(x1, **kwargs)[source]
Return the cumulative sum of the elements along a given axis.
For full documentation refer to
numpy.cumsum.Limitations
Parameter
xis supported asdpnp.ndarray. Keyword argumentskwargsare currently unsupported. Otherwise the functions will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types.Examples
>>> import dpnp as np >>> a = np.array([1, 2, 4]) >>> result = np.cumsum(a) >>> [x for x in result] [1, 2, 7] >>> b = np.array([[1, 2, 3], [4, 5, 6]]) >>> result = np.cumsum(b) >>> [x for x in result] [1, 2, 6, 10, 15, 21]