File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change 15
15
# limitations under the License.
16
16
17
17
import itertools
18
+ import warnings
18
19
19
20
import numpy as np
20
21
import pytest
@@ -203,12 +204,18 @@ def test_complex_special_cases(dtype):
203
204
Xc = dpt .asarray (Xc_np , dtype = dtype , sycl_queue = q )
204
205
205
206
tol = 8 * dpt .finfo (dtype ).resolution
206
- assert_allclose (
207
- dpt .asnumpy (dpt .real (Xc )), np .real (Xc_np ), atol = tol , rtol = tol
208
- )
209
- assert_allclose (
210
- dpt .asnumpy (dpt .imag (Xc )), np .imag (Xc_np ), atol = tol , rtol = tol
211
- )
212
- assert_allclose (
213
- dpt .asnumpy (dpt .conj (Xc )), np .conj (Xc_np ), atol = tol , rtol = tol
214
- )
207
+
208
+ actual = dpt .real (Xc )
209
+ expected = np .real (Xc_np )
210
+ assert_allclose (dpt .asnumpy (actual ), expected , atol = tol , rtol = tol )
211
+
212
+ actual = dpt .imag (Xc )
213
+ expected = np .imag (Xc_np )
214
+ assert_allclose (dpt .asnumpy (actual ), expected , atol = tol , rtol = tol )
215
+
216
+ actual = dpt .conj (Xc )
217
+ expected = np .conj (Xc_np )
218
+
219
+ with warnings .catch_warnings ():
220
+ warnings .simplefilter ("ignore" )
221
+ assert_allclose (dpt .asnumpy (actual ), expected , atol = tol , rtol = tol )
You can’t perform that action at this time.
0 commit comments