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 34e8aac commit 40ba4a0Copy full SHA for 40ba4a0
test/legacy_test/test_ldexp.py
@@ -130,6 +130,21 @@ def test_ldexp_dynamic(self):
130
check_dtype(res, np.float32)
131
np.testing.assert_allclose(res, np.ldexp(x, y))
132
133
+ # test 0-d
134
+ dims = (np.random.randint(10),)
135
+ x = (np.random.rand(*dims) * 10).astype(np.float64)
136
+ y = (np.random.randint(-10, 10, dims)).astype(np.int32)
137
+ res = _run_ldexp_dynamic(x, y, place)
138
+ check_dtype(res, np.float64)
139
+ np.testing.assert_allclose(res, np.ldexp(x, y))
140
+
141
142
+ x = (np.random.randint(-10, 10, dims)).astype(np.int32)
143
144
145
+ check_dtype(res, np.float32)
146
147
148
# test broadcast
149
dims = (
150
np.random.randint(1, 10),
0 commit comments