File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,7 @@ class _NumPyAPIWrapper:
226
226
"uint16" ,
227
227
"uint32" ,
228
228
"uint64" ,
229
+ "float16" ,
229
230
"float32" ,
230
231
"float64" ,
231
232
"complex64" ,
Original file line number Diff line number Diff line change 2
2
import pytest
3
3
from numpy .testing import assert_allclose , assert_array_equal
4
4
5
+ from sklearn .base import BaseEstimator
6
+ from sklearn .utils ._array_api import get_namespace
7
+ from sklearn .utils ._array_api import _NumPyAPIWrapper
8
+ from sklearn .utils ._array_api import _ArrayAPIWrapper
9
+ from sklearn .utils ._array_api import _asarray_with_order
10
+ from sklearn .utils ._array_api import _convert_to_numpy
11
+ from sklearn .utils ._array_api import _estimator_with_converted_arrays
12
+ from sklearn .utils ._array_api import supported_float_dtypes
13
+ from sklearn .utils ._testing import skip_if_array_api_compat_not_configured
14
+
5
15
from sklearn ._config import config_context
6
16
from sklearn .base import BaseEstimator
7
17
from sklearn .utils ._array_api import (
@@ -256,6 +266,9 @@ def test_get_namespace_array_api_isdtype(wrapper):
256
266
assert xp .isdtype (xp .float64 , "real floating" )
257
267
assert not xp .isdtype (xp .int32 , "real floating" )
258
268
269
+ for dtype in supported_float_dtypes (xp ):
270
+ assert xp .isdtype (dtype , "real floating" )
271
+
259
272
assert xp .isdtype (xp .bool , "bool" )
260
273
assert not xp .isdtype (xp .float32 , "bool" )
261
274
You can’t perform that action at this time.
0 commit comments