We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
mutually_promotable_dtypes
1 parent b436fd8 commit eb706caCopy full SHA for eb706ca
array_api_tests/meta/test_partial_adopters.py
@@ -0,0 +1,18 @@
1
+import pytest
2
+from hypothesis import given
3
+
4
+from .. import dtype_helpers as dh
5
+from .. import hypothesis_helpers as hh
6
+from .. import _array_module as xp
7
+from .._array_module import _UndefinedStub
8
9
10
+# e.g. PyTorch only supports uint8 currently
11
+@pytest.mark.skipif(isinstance(xp.uint8, _UndefinedStub), reason="uint8 not defined")
12
+@pytest.mark.skipif(
13
+ not all(isinstance(d, _UndefinedStub) for d in dh.uint_dtypes[1:]),
14
+ reason="uints defined",
15
+)
16
+@given(hh.mutually_promotable_dtypes(dtypes=dh.uint_dtypes))
17
+def test_mutually_promotable_dtypes(pair):
18
+ assert pair == (xp.uint8, xp.uint8)
0 commit comments