Skip to content

Commit

Permalink
Handle float128 generically
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed May 23, 2024
1 parent 95ba099 commit b80baf4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python-package/xgboost/collective.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ def _map_dtype(dtype: np.dtype) -> int:
np.dtype("uint32"): 10,
np.dtype("uint64"): 11,
}
if platform.system() != "Windows":
try:
dtype_map.update({np.dtype("float128"): 3})
except TypeError: # float128 doesn't exist on the system
pass

if dtype not in dtype_map:
raise TypeError(f"data type {dtype} is not supported on the current platform.")
Expand Down

0 comments on commit b80baf4

Please sign in to comment.