From 24f4fb6aae9920949fbd36d7a25a09c29b21a931 Mon Sep 17 00:00:00 2001 From: Edwin Solis Date: Sat, 7 Jun 2025 22:34:57 -0700 Subject: [PATCH] Fixed double casting to array when calling af.cplx with two arrays --- arrayfire/library/mathematical_functions.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arrayfire/library/mathematical_functions.py b/arrayfire/library/mathematical_functions.py index bc7b970..0d2e99b 100644 --- a/arrayfire/library/mathematical_functions.py +++ b/arrayfire/library/mathematical_functions.py @@ -261,12 +261,11 @@ def atan2(x1: int | float | Array, x2: int | float | Array, /) -> Array: return process_c_function(x1, x2, wrapper.atan2) -@afarray_as_array def cplx(x1: int | float | Array, /, x2: int | float | Array | None = None) -> Array: if x2 is None: if not isinstance(x1, Array): raise TypeError("x1 can not be int or tuple when x2 is None.") - return cast(Array, wrapper.cplx(x1.arr)) + return Array.from_afarray(Array, wrapper.cplx(x1.arr)) else: return process_c_function(x1, x2, wrapper.cplx2)