dpnp.sum

dpnp.sum(x1, axis=None, dtype=None, out=None, keepdims=False, initial=None, where=True)[source]

Sum of array elements over a given axis.

For full documentation refer to numpy.sum.

Limitations

Parameter where` is unsupported. Input array data types are limited by DPNP Data types.

Examples

>>> import dpnp as np
>>> np.sum(np.array([1, 2, 3, 4, 5]))
15
>>> result = np.sum([[0, 1], [0, 5]], axis=0)
[0, 6]