diff options
Diffstat (limited to 'numpy/_array_api')
-rw-r--r-- | numpy/_array_api/_dtypes.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/numpy/_array_api/_dtypes.py b/numpy/_array_api/_dtypes.py index d33ae1fce..c874763dd 100644 --- a/numpy/_array_api/_dtypes.py +++ b/numpy/_array_api/_dtypes.py @@ -1,6 +1,19 @@ -from .. import int8, int16, int32, int64, uint8, uint16, uint32, uint64, float32, float64 +import numpy as np + +# Note: we use dtype objects instead of dtype classes. The spec does not +# require any behavior on dtypes other than equality. +int8 = np.dtype('int8') +int16 = np.dtype('int16') +int32 = np.dtype('int32') +int64 = np.dtype('int64') +uint8 = np.dtype('uint8') +uint16 = np.dtype('uint16') +uint32 = np.dtype('uint32') +uint64 = np.dtype('uint64') +float32 = np.dtype('float32') +float64 = np.dtype('float64') # Note: This name is changed -from .. import bool_ as bool +bool = np.dtype('bool') _all_dtypes = [int8, int16, int32, int64, uint8, uint16, uint32, uint64, float32, float64, bool] |