From 70a999d9fe49de34594056fddd8e8473df7dbe00 Mon Sep 17 00:00:00 2001 From: XiaLuNV Date: Tue, 5 Dec 2023 16:16:15 +0000 Subject: [PATCH] add more input datatype for test_binary_ufunc.py --- tests/integration/test_binary_ufunc.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/integration/test_binary_ufunc.py b/tests/integration/test_binary_ufunc.py index a6acef049..cf30a1f4d 100644 --- a/tests/integration/test_binary_ufunc.py +++ b/tests/integration/test_binary_ufunc.py @@ -24,7 +24,10 @@ def check_result(op, in_np, out_np, out_num): - result = allclose(out_np, out_num) and out_np.dtype == out_num.dtype + rtol = 1e-02 if any(x.dtype == np.float16 for x in in_np) else 1e-05 + result = ( + allclose(out_np, out_num, rtol=rtol) and out_np.dtype == out_num.dtype + ) if not result: print(f"cunumeric.{op} failed the test") print("Inputs:") @@ -128,8 +131,12 @@ def test_all(): # We want to test array-array, array-scalar, and scalar-array cases arrs = ( np.random.randint(3, 10, size=(4, 5)).astype("I"), + np.random.uniform(size=(4, 5)).astype("e"), + np.random.uniform(size=(4, 5)).astype("f"), + np.random.uniform(size=(4, 5)).astype("d"), np.random.uniform(size=(4, 5)).astype("F"), ) + scalars = ( np.uint64(2), np.int64(-3), @@ -152,6 +159,7 @@ def test_all(): "arctan2", "copysign", "floor_divide", + "mod", "fmod", "hypot", "logaddexp",