File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11
11
12
12
13
13
# You can comment the following out and instead import the specific array module
14
- # you want to test, e.g. `import numpy.array_api as xp`.
14
+ # you want to test, e.g. `import array_api_strict as xp`.
15
15
if "ARRAY_API_TESTS_MODULE" in os<
8000
/span>.environ :
16
16
xp_name = os .environ ["ARRAY_API_TESTS_MODULE" ]
17
17
_module , _sub = xp_name , None
33
33
)
34
34
35
35
36
+ # If xp.bool is not available, like in some versions of NumPy and CuPy, try
37
+ # patching in xp.bool_.
38
+ try :
39
+ xp .bool
40
+ except AttributeError as e :
41
+ if hasattr (xp , "bool_" ):
42
+ xp .bool = xp .bool_
43
+ else :
44
+ raise e
45
+
46
+
36
47
# We monkey patch floats() to always disable subnormals as they are out-of-scope
37
48
38
49
_floats = st .floats
You can’t perform that action at this time.
0 commit comments