From 29fb043bd6d4b0c01671cf84ea3e5ed71843ea05 Mon Sep 17 00:00:00 2001 From: Illviljan <14371165+Illviljan@users.noreply.github.com> Date: Sun, 1 Sep 2024 18:33:18 +0200 Subject: [PATCH] Update _creation_functions.py --- xarray/namedarray/_array_api/_creation_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/namedarray/_array_api/_creation_functions.py b/xarray/namedarray/_array_api/_creation_functions.py index 68580c77bb8..72706a8331c 100644 --- a/xarray/namedarray/_array_api/_creation_functions.py +++ b/xarray/namedarray/_array_api/_creation_functions.py @@ -141,7 +141,7 @@ def empty_like( device: _Device | None = None, ) -> NamedArray[_ShapeType, _DType]: xp = _get_data_namespace(x) - _data = xp.empty(x._data, dtype=dtype, device=device) + _data = xp.empty_like(x._data, dtype=dtype, device=device) return x._new(data=_data)