Skip to content

Commit 3cbec4a

Browse files
Merge pull request #1018 from IntelPython/sum-array-method
sum array method added
2 parents 8d1f4aa + d7872f0 commit 3cbec4a

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

dpnp/dpnp_array.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,18 @@ def strides(self):
668668

669669
return self._array_obj.strides
670670

671-
# 'sum',
671+
def sum(self, axis=None, dtype=None, out=None, keepdims=False, initial=0, where=True):
672+
"""
673+
Returns the sum along a given axis.
674+
675+
.. seealso::
676+
:obj:`dpnp.sum` for full documentation,
677+
:meth:`dpnp.dparray.sum`
678+
679+
"""
680+
681+
return dpnp.sum(self, axis, dtype, out, keepdims, initial, where)
682+
672683
# 'swapaxes',
673684
# 'take',
674685
# 'tobytes',
@@ -691,4 +702,3 @@ def transpose(self, *axes):
691702

692703
# 'var',
693704
# 'view'
694-

tests/skipped_tests_gpu.tbl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,9 +1103,6 @@ tests/third_party/cupy/math_tests/test_rounding.py::TestRounding::test_rint_nega
11031103
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_prod_all
11041104
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_prod_axis
11051105
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_prod_dtype
1106-
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_sum_all
1107-
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_sum_all2
1108-
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_sum_all_keepdims
11091106
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_sum_all_transposed
11101107
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_sum_all_transposed2
11111108
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_sum_axes

0 commit comments

Comments
 (0)