diff options
author | Aaron Meurer <asmeurer@gmail.com> | 2021-07-16 15:02:10 -0600 |
---|---|---|
committer | Aaron Meurer <asmeurer@gmail.com> | 2021-07-16 15:02:10 -0600 |
commit | d9b958259bda8db50949922770101217b2d0b50a (patch) | |
tree | 8964fc0ac699dbe87b6b1566f0aaf263e53c9486 /numpy/_array_api/_creation_functions.py | |
parent | 185d06d45cbc21ad06d7719ff265b1132d1c41ff (diff) | |
download | numpy-d9b958259bda8db50949922770101217b2d0b50a.tar.gz |
Move the dtype check to the array API Array._new constructor
Diffstat (limited to 'numpy/_array_api/_creation_functions.py')
-rw-r--r-- | numpy/_array_api/_creation_functions.py | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/numpy/_array_api/_creation_functions.py b/numpy/_array_api/_creation_functions.py index 2be0aea09..24d28a3fa 100644 --- a/numpy/_array_api/_creation_functions.py +++ b/numpy/_array_api/_creation_functions.py @@ -32,8 +32,6 @@ def asarray(obj: Union[Array, float, NestedSequence[bool|int|float], SupportsDLP # to an object array. raise OverflowError("Integer out of bounds for array dtypes") res = np.asarray(obj, dtype=dtype) - if res.dtype not in _all_dtypes: - raise TypeError(f"The array_api namespace does not support the dtype '{res.dtype}'") return Array._new(res) def arange(start: Union[int, float], /, stop: Optional[Union[int, float]] = None, step: Union[int, float] = 1, *, dtype: Optional[Dtype] = None, device: Optional[Device] = None) -> Array: |