Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dpnp/tests/test_mathematical.py
Original file line number Diff line number Diff line change
Expand Up @@ -2111,14 +2111,15 @@ def test_zeros(self, dt):

result = dpnp.spacing(ia)
expected = numpy.spacing(a)
tol = numpy.finfo(expected.dtype).resolution
if numpy.lib.NumpyVersion(numpy.__version__) < "2.0.0":
assert_equal(result, expected)
assert_allclose(result, expected, rtol=tol, atol=tol)
else:
# numpy.spacing(-0.0) == numpy.spacing(0.0), i.e. NumPy returns
# positive value (looks as a bug in NumPy), because for any other
# negative input the NumPy result will be also a negative value.
expected[1] *= -1
assert_equal(result, expected)
assert_allclose(result, expected, rtol=tol, atol=tol)

@pytest.mark.parametrize("dt", get_float_dtypes(no_float16=False))
@pytest.mark.parametrize("val", [1, 1e-5, 1000])
Expand Down
4 changes: 2 additions & 2 deletions dpnp/tests/test_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ def test_axes(self, dtype, axes):

result = dpnp.tensordot(ia, ib, axes=axes)
expected = numpy.tensordot(a, b, axes=axes)
assert_dtype_allclose(result, expected)
assert_dtype_allclose(result, expected, factor=9)

@pytest.mark.parametrize("dtype1", get_all_dtypes())
@pytest.mark.parametrize("dtype2", get_all_dtypes())
Expand Down Expand Up @@ -844,7 +844,7 @@ def test_linalg(self, axes):

result = dpnp.linalg.tensordot(ia, ib, axes=axes)
expected = numpy.linalg.tensordot(a, b, axes=axes)
assert_dtype_allclose(result, expected)
assert_dtype_allclose(result, expected, factor=9)

def test_error(self):
a = 5
Expand Down
Loading