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
11 changes: 8 additions & 3 deletions dpnp/tests/third_party/cupy/math_tests/test_hyperbolic.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
import unittest

import numpy

from dpnp.tests.helper import has_support_aspect64
from dpnp.tests.third_party.cupy import testing


class TestHyperbolic(unittest.TestCase):

@testing.for_all_dtypes()
@testing.numpy_cupy_allclose(atol=1e-5, type_check=has_support_aspect64())
@testing.numpy_cupy_allclose(
atol={numpy.float16: 1e-3, "default": 1e-5},
type_check=has_support_aspect64(),
)
def check_unary(self, name, xp, dtype):
a = testing.shaped_arange((2, 3), xp, dtype)
return getattr(xp, name)(a)

@testing.for_dtypes(["e", "f", "d"])
@testing.numpy_cupy_allclose(atol=1e-5)
@testing.numpy_cupy_allclose(atol={numpy.float16: 1e-3, "default": 1e-5})
def check_unary_unit(self, name, xp, dtype):
a = xp.array([0.2, 0.4, 0.6, 0.8], dtype=dtype)
return getattr(xp, name)(a)
Expand All @@ -31,7 +36,7 @@ def test_arcsinh(self):
self.check_unary("arcsinh")

@testing.for_dtypes(["e", "f", "d"])
@testing.numpy_cupy_allclose(atol=1e-5)
@testing.numpy_cupy_allclose(atol={numpy.float16: 1e-3, "default": 1e-5})
def test_arccosh(self, xp, dtype):
a = xp.array([1, 2, 3], dtype=dtype)
return xp.arccosh(a)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest

import numpy
import pytest

from dpnp.tests.helper import has_support_aspect64
Expand All @@ -24,7 +25,7 @@ def check_binary(self, name, xp, dtype):
return getattr(xp, name)(a, b)

@testing.for_dtypes(["e", "f", "d"])
@testing.numpy_cupy_allclose(atol=1e-5)
@testing.numpy_cupy_allclose(atol={numpy.float16: 1e-3, "default": 1e-5})
def check_unary_unit(self, name, xp, dtype):
a = xp.array([0.2, 0.4, 0.6, 0.8], dtype=dtype)
return getattr(xp, name)(a)
Expand Down
Loading