Skip to content

Commit a1d8054

Browse files
edwinsolisfsyurkevi
authored andcommitted
Fixed double casting to array when calling af.cplx with two arrays
1 parent 1971d99 commit a1d8054

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arrayfire/library/mathematical_functions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,11 @@ def atan2(x1: int | float | Array, x2: int | float | Array, /) -> Array:
261261
return process_c_function(x1, x2, wrapper.atan2)
262262

263263

264-
@afarray_as_array
265264
def cplx(x1: int | float | Array, /, x2: int | float | Array | None = None) -> Array:
266265
if x2 is None:
267266
if not isinstance(x1, Array):
268267
raise TypeError("x1 can not be int or tuple when x2 is None.")
269-
return cast(Array, wrapper.cplx(x1.arr))
268+
return Array.from_afarray(Array, wrapper.cplx(x1.arr))
270269
else:
271270
return process_c_function(x1, x2, wrapper.cplx2)
272271

0 commit comments

Comments
 (0)