|
23 | 23 | default_device_int_type,
|
24 | 24 | )
|
25 | 25 |
|
26 |
| -__array_api_version__ = "2022.12" |
27 |
| - |
28 |
| - |
29 |
| -def _isdtype_impl(dtype, kind): |
30 |
| - if isinstance(kind, dpt.dtype): |
31 |
| - return dtype == kind |
| 26 | +from ._data_types import _isdtype_impl |
32 | 27 |
|
33 |
| - elif isinstance(kind, str): |
34 |
| - if kind == "bool": |
35 |
| - return dtype.kind == "b" |
36 |
| - elif kind == "signed integer": |
37 |
| - return dtype.kind == "i" |
38 |
| - elif kind == "unsigned integer": |
39 |
| - return dtype.kind == "u" |
40 |
| - elif kind == "integral": |
41 |
| - return dtype.kind in "iu" |
42 |
| - elif kind == "real floating": |
43 |
| - return dtype.kind == "f" |
44 |
| - elif kind == "complex floating": |
45 |
| - return dtype.kind == "c" |
46 |
| - elif kind == "numeric": |
47 |
| - return dtype.kind in "iufc" |
48 |
| - else: |
49 |
| - raise ValueError(f"Unrecognized data type kind: {kind}") |
50 |
| - |
51 |
| - elif isinstance(kind, tuple): |
52 |
| - return any(_isdtype_impl(dtype, k) for k in kind) |
53 |
| - else: |
54 |
| - raise TypeError(f"Unsupported data type kind: {kind}") |
| 28 | +__array_api_version__ = "2022.12" |
55 | 29 |
|
56 | 30 |
|
57 | 31 | class __array_namespace_info__:
|
@@ -88,7 +62,7 @@ def default_dtypes(self, device=None):
|
88 | 62 | device = dpctl.select_default_device()
|
89 | 63 | return {
|
90 | 64 | "real floating": default_device_fp_type(device),
|
91 |
| - "complex floating": default_device_complex_type, |
| 65 | + "complex floating": default_device_complex_type(device), |
92 | 66 | "integral": default_device_int_type(device),
|
93 | 67 | "indexing": default_device_index_type(device),
|
94 | 68 | }
|
|
0 commit comments