Handle float128 generically (#10322)
This commit is contained in:
parent
8998733ef4
commit
324f2d4e4a
@ -4,7 +4,6 @@ import ctypes
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import pickle
|
import pickle
|
||||||
import platform
|
|
||||||
from enum import IntEnum, unique
|
from enum import IntEnum, unique
|
||||||
from typing import Any, Dict, List, Optional
|
from typing import Any, Dict, List, Optional
|
||||||
|
|
||||||
@ -184,8 +183,10 @@ def _map_dtype(dtype: np.dtype) -> int:
|
|||||||
np.dtype("uint32"): 10,
|
np.dtype("uint32"): 10,
|
||||||
np.dtype("uint64"): 11,
|
np.dtype("uint64"): 11,
|
||||||
}
|
}
|
||||||
if platform.system() != "Windows":
|
try:
|
||||||
dtype_map.update({np.dtype("float128"): 3})
|
dtype_map.update({np.dtype("float128"): 3})
|
||||||
|
except TypeError: # float128 doesn't exist on the system
|
||||||
|
pass
|
||||||
|
|
||||||
if dtype not in dtype_map:
|
if dtype not in dtype_map:
|
||||||
raise TypeError(f"data type {dtype} is not supported on the current platform.")
|
raise TypeError(f"data type {dtype} is not supported on the current platform.")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user