We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6841d9c + b3a9ef4 commit e38ce34Copy full SHA for e38ce34
array_api_tests/__init__.py
@@ -11,7 +11,7 @@
11
12
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`.
+# you want to test, e.g. `import array_api_strict as xp`.
15
if "ARRAY_API_TESTS_MODULE" in os.environ:
16
xp_name = os.environ["ARRAY_API_TESTS_MODULE"]
17
_module, _sub = xp_name, None
@@ -33,6 +33,17 @@
33
)
34
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
47
# We monkey patch floats() to always disable subnormals as they are out-of-scope
48
49
_floats = st.floats
0 commit comments