Skip to content

Commit 8c36c6d

Browse files
trivialfishcho3
andauthored
[backport] Handle float128 generically (#10322) (#10348)
Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
1 parent bc6c993 commit 8c36c6d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

python-package/xgboost/collective.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import logging
55
import os
66
import pickle
7-
import platform
87
from enum import IntEnum, unique
98
from typing import Any, Dict, List, Optional
109

@@ -184,8 +183,10 @@ def _map_dtype(dtype: np.dtype) -> int:
184183
np.dtype("uint32"): 10,
185184
np.dtype("uint64"): 11,
186185
}
187-
if platform.system() != "Windows":
186+
try:
188187
dtype_map.update({np.dtype("float128"): 3})
188+
except TypeError: # float128 doesn't exist on the system
189+
pass
189190

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

0 commit comments

Comments
 (0)