29
29
# We might as well use this implementation rather than xp.broadcast_shapes()
30
30
from .test_broadcasting import broadcast_shapes
31
31
32
+
33
+ # When appropiate, this module tests operators alongside their respective
34
+ # elementwise methods. We do this by parametrizing a generalised test method
35
+ # with every relevant method and operator.
36
+ #
37
+ # Notable arguments in the parameter:
38
+ # - The function object, which for operator test cases is a wrapper that allows
39
+ # test logic to be generalised.
40
+ # - The argument strategies, which can be used to draw arguments for the test
41
+ # case. They may require additional filtering for certain test cases.
42
+ # - right_is_scalar (binary parameters), which denotes if the right argument is
43
+ # a scalar in a test case. This can be used to appropiately adjust draw
44
+ # filtering and test logic.
45
+
46
+
32
47
func_to_op = {v : k for k , v in dh .op_to_func .items ()}
48
+ all_op_to_symbol = {** dh .binary_op_to_symbol , ** dh .inplace_op_to_symbol }
49
+ finite_kw = {"allow_nan" : False , "allow_infinity" : False }
33
50
34
51
unary_argnames = ("func_name" , "func" , "strat" )
35
52
UnaryParam = Param [str , Callable [[Array ], Array ], st .SearchStrategy [Array ]]
@@ -48,9 +65,6 @@ def make_unary_params(
48
65
]
49
66
50
67
51
- all_op_to_symbol = {** dh .binary_op_to_symbol , ** dh .inplace_op_to_symbol }
52
- finite_kw = {"allow_nan" : False , "allow_infinity" : False }
53
-
54
68
binary_argnames = (
55
69
"func_name" ,
56
70
"func" ,
0 commit comments