We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42b199d commit e0b6f0eCopy full SHA for e0b6f0e
tests/test_sum.py
@@ -27,10 +27,17 @@ def test_sum_float(dtype):
27
)
28
ia = dpnp.array(a)
29
30
+ # Flag for type check in special cases
31
+ # Skip dtype checks when dpnp handles float32 arrays
32
+ # as `dpnp.sum()` and `numpy.sum()` return different dtypes
33
+ check_dtype = dtype != dpnp.float32
34
for axis in range(len(a)):
35
result = dpnp.sum(ia, axis=axis)
36
expected = numpy.sum(a, axis=axis)
- assert_dtype_allclose(result, expected)
37
+ assert_dtype_allclose(result, expected, check_type=check_dtype)
38
+ if not check_dtype:
39
+ # Ensure dtype kind matches when check_dtype is False
40
+ assert result.dtype.kind == expected.dtype.kind
41
42
43
def test_sum_int():
0 commit comments