Skip to content

Commit 839b9b7

Browse files
author
Raghuveer Devulapalli
committed
TST: Adjust for ULP errors in FP16 math functions
1 parent 53cb336 commit 839b9b7

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎numpy/core/tests/test_umath.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@ def test_tanh(self):
15831583
for dt in ['e', 'f', 'd']:
15841584
in_arr = np.array(in_, dtype=dt)
15851585
out_arr = np.array(out, dtype=dt)
1586-
assert_equal(np.tanh(in_arr), out_arr)
1586+
assert_array_max_ulp(np.tanh(in_arr), out_arr, 3)
15871587

15881588
def test_arcsinh(self):
15891589
in_ = [np.nan, -np.nan, np.inf, -np.inf]

‎numpy/core/tests/test_umath_accuracy.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,6 @@ def test_validate_svml_fp16(self):
111111
datafp32 = datafp16.astype(np.float32)
112112
for func in max_ulp_err:
113113
ufunc = getattr(np, func)
114-
ulp = max_ulp_err[func]
114+
ulp = np.ceil(max_ulp_err[func])
115115
assert_array_max_ulp(ufunc(datafp16), ufunc(datafp32),
116116
maxulp=ulp, dtype=np.float16)

0 commit comments

Comments
 (0)