File tree 1 file changed +3
-13
lines changed
1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change 7
7
spec does not make any accuracy requirements for functions, so this does not
8
8
test that. Tests for the special cases are generated and tested separately in
9
9
special_cases/
10
-
11
- Note: Due to current limitations in Hypothesis, the tests below only test
12
- arrays of shape (). In the future, the tests should be updated to test
13
- arrays of any shape, using masking patterns (similar to the tests in special_cases/
14
-
15
10
"""
16
11
17
12
import math
@@ -913,18 +908,13 @@ def test_tanh(x):
913
908
# a = xp.tanh(x)
914
909
pass
915
910
916
- @given (
917
- xps .arrays (
918
- dtype = hh .numeric_dtypes ,
919
- shape = xps .array_shapes (),
920
- elements = {"allow_nan" : False , "allow_infinity" : False },
921
- )
922
- )
911
+ @given (xps .arrays (dtype = hh .numeric_dtypes , shape = xps .array_shapes ()))
923
912
def test_trunc (x ):
924
913
out = xp .trunc (x )
925
914
assert out .dtype == x .dtype , f"{ x .dtype = !s} but { out .dtype = !s} "
926
915
assert out .shape == x .shape , f"{ x .shape = } but { out .shape = } "
927
916
if x .dtype in hh .integer_dtype_objects :
928
917
assert ah .all (ah .equal (x , out )), f"{ x = !s} but { out = !s} "
929
918
else :
930
- ah .assert_integral (out )
919
+ finite = ah .isfinite (x )
920
+ ah .assert_integral (out [finite ])
You can’t perform that action at this time.
0 commit comments