From 3637e235c69e29f58048f316692f38d947dd9dd4 Mon Sep 17 00:00:00 2001 From: Alex Merose Date: Sat, 3 Aug 2024 17:51:01 +0100 Subject: [PATCH] Fix underlying bug in asarray. --- cubed/array_api/creation_functions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cubed/array_api/creation_functions.py b/cubed/array_api/creation_functions.py index 06e0dcb77..f45d9a847 100644 --- a/cubed/array_api/creation_functions.py +++ b/cubed/array_api/creation_functions.py @@ -78,6 +78,7 @@ def asarray( a = nxp.asarray(a, dtype=dtype) if dtype is None: dtype = _to_default_precision(a.dtype, device=device) + a = a.astype(dtype) chunksize = to_chunksize(normalize_chunks(chunks, shape=a.shape, dtype=dtype)) name = gensym()