Skip to content

Commit 83deb0d

Browse files
Update test_sum
1 parent 4343118 commit 83deb0d

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

tests/test_sum.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
import dpnp
2+
from .helper import skip_or_change_if_dtype_not_supported
23

34
import numpy
45

56

6-
def test_sum_float64():
7-
a = numpy.array([[[-2., 3.], [9.1, 0.2]], [[-2., 5.0], [-2, -1.2]], [[1.0, -2.], [5.0, -1.1]]])
7+
dtype = skip_or_change_if_dtype_not_supported(numpy.float64, change_dtype=True)
8+
9+
10+
def test_sum_float():
11+
a = numpy.array(
12+
[
13+
[[-2.0, 3.0], [9.1, 0.2]],
14+
[[-2.0, 5.0], [-2, -1.2]],
15+
[[1.0, -2.0], [5.0, -1.1]],
16+
],
17+
dtype=dtype,
18+
)
819
ia = dpnp.array(a)
920

1021
for axis in range(len(a)):
@@ -23,7 +34,14 @@ def test_sum_int():
2334

2435

2536
def test_sum_axis():
26-
a = numpy.array([[[-2., 3.], [9.1, 0.2]], [[-2., 5.0], [-2, -1.2]], [[1.0, -2.], [5.0, -1.1]]])
37+
a = numpy.array(
38+
[
39+
[[-2.0, 3.0], [9.1, 0.2]],
40+
[[-2.0, 5.0], [-2, -1.2]],
41+
[[1.0, -2.0], [5.0, -1.1]],
42+
],
43+
dtype=dtype,
44+
)
2745
ia = dpnp.array(a)
2846

2947
result = dpnp.sum(ia, axis=1)

0 commit comments

Comments
 (0)