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.
1 parent ec4f628 commit 9df9aa8Copy full SHA for 9df9aa8
tests/test_common.py
@@ -60,3 +60,16 @@ def test_to_device_host(library):
60
# here is that we can test portably after calling
61
# to_device(x, "cpu") to return to host
62
assert_allclose(x, expected)
63
+
64
65
+@pytest.mark.parametrize("target_library,func", is_functions.items())
66
+@pytest.mark.parametrize("source_library", is_functions.keys())
67
+def test_asarray(source_library, target_library, func):
68
+ src_lib = import_(source_library, wrapper=True)
69
+ tgt_lib = import_(target_library, wrapper=True)
70
+ is_tgt_type = globals()[func]
71
72
+ a = src_lib.asarray([1, 2, 3])
73
+ b = tgt_lib.asarray(a)
74
75
+ assert is_tgt_type(b), f"Expected {b} to be a {tgt_lib.ndarray}, but was {type(b)}"
0 commit comments