@@ -78,25 +78,31 @@ def replace_scalar(lhs: AFArray, cond_arr: AFArray, rhs: int | float, /) -> None
|
78 | 78 | call_from_clib(replace.__name__, lhs, cond_arr, ctypes.c_double(rhs))
|
79 | 79 |
|
80 | 80 |
|
81 |
| -def select(lhs: AFArray, cond_arr: AFArray, rhs: AFArray, /) -> None: |
| 81 | +def select(lhs: AFArray, cond_arr: AFArray, rhs: AFArray, /) -> AFArray: |
82 | 82 | """
|
83 | 83 | source: https://arrayfire.org/docs/group__data__func__select.htm#gac4af16e31ddd5ddcf09b670f676fd093
|
84 | 84 | """
|
85 |
| -call_from_clib(select.__name__, cond_arr, lhs, rhs) |
| 85 | +out = AFArray.create_null_pointer() |
| 86 | +call_from_clib(select.__name__, ctypes.pointer(out), cond_arr, lhs, rhs) |
| 87 | +return out |
86 | 88 |
|
87 | 89 |
|
88 |
| -def select_scalar_l(lhs: int | float, cond_arr: AFArray, rhs: AFArray, /) -> None: |
| 90 | +def select_scalar_l(lhs: int | float, cond_arr: AFArray, rhs: AFArray, /) -> AFArray: |
89 | 91 | """
|
90 | 92 | source: https://arrayfire.org/docs/group__data__func__select.htm#gac4af16e31ddd5ddcf09b670f676fd093
|
91 | 93 | """
|
92 |
| -call_from_clib(select_scalar_l.__name__, cond_arr, ctypes.c_double(lhs), rhs) |
| 94 | +out = AFArray.create_null_pointer() |
| 95 | +call_from_clib(select_scalar_l.__name__, ctypes.pointer(out), cond_arr, ctypes.c_double(lhs), rhs) |
| 96 | +return out |
93 | 97 |
|
94 | 98 |
|
95 |
| -def select_scalar_r(lhs: AFArray, cond_arr: AFArray, rhs: int | float, /) -> None: |
| 99 | +def select_scalar_r(lhs: AFArray, cond_arr: AFArray, rhs: int | float, /) -> AFArray: |
96 | 100 | """
|
97 | 101 | source: https://arrayfire.org/docs/group__data__func__select.htm#gac4af16e31ddd5ddcf09b670f676fd093
|
98 | 102 | """
|
99 |
| -call_from_clib(select_scalar_l.__name__, cond_arr, lhs, ctypes.c_double(rhs)) |
| 103 | +out = AFArray.create_null_pointer() |
| 104 | +call_from_clib(select_scalar_l.__name__, ctypes.pointer(out), cond_arr, lhs, ctypes.c_double(rhs)) |
| 105 | +return out |
100 | 106 |
|
101 | 107 |
|
102 | 108 | def shift(arr: AFArray, /, d0: int, d1: int = 0, d2: int = 0, d3: int = 0) -> AFArray:
|
|
0 commit comments