Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions mkl_fft/interfaces/_float_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@

import numpy as np

# dtypes the scipy.fft interface rejects; np.dtype keys make `in` a hash lookup
_UNSUPPORTED_DTYPES = frozenset(
np.dtype(getattr(np, name))
for name in ("half", "float128", "complex256")
if hasattr(np, name)
)


def _upcast_float16_array(x):
"""
Expand Down Expand Up @@ -78,11 +85,6 @@ def _supported_array_or_not_implemented(x):
or complex128 type or raise NotImplementedError
"""
_x = np.asarray(x)
black_list = [np.half]
if hasattr(np, "float128"):
black_list.append(np.float128)
if hasattr(np, "complex256"):
black_list.append(np.complex256)
if _x.dtype in black_list:
if _x.dtype in _UNSUPPORTED_DTYPES:
raise NotImplementedError
return _x
Loading