Skip to content

Commit 61e5972

Browse files
Bumped copyright year, added function for use in scipy_fft_backend
1 parent 9496d27 commit 61e5972

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

mkl_fft/_float_utils.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# Copyright (c) 2017-2019, Intel Corporation
2+
# Copyright (c) 2017-2023, Intel Corporation
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions are met:
@@ -25,7 +25,7 @@
2525
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626

2727
from numpy import (half, float32, asarray, ndarray,
28-
longdouble, float64, longcomplex, complex_)
28+
longdouble, float64, longcomplex, complex_, float128, complex256)
2929

3030
__all__ = ['__upcast_float16_array', '__downcast_float128_array']
3131

@@ -71,3 +71,14 @@ def __downcast_float128_array(x):
7171
return asarray(x, dtype=complex_)
7272
return __x
7373
return x
74+
75+
76+
def __supported_array_or_not_implemented(x):
77+
"""
78+
Used in _scipy_fft_backend to convert array to float32,
79+
float64, complex64, or complex128 type or return NotImplemented
80+
"""
81+
__x = asarray(x)
82+
if __x.dtype in [half, float128, complex256]:
83+
return NotImplemented
84+
return x

0 commit comments

Comments
 (0)