Skip to content

Commit 06af1a2

Browse files
committed
Hotfix backend iterator and identity out init
1 parent 1c07bda commit 06af1a2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arrayfire_wrapper/_backend.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class BackendType(enum.Enum): # TODO change name - avoid using _backend_type -
115115

116116
def __iter__(self) -> Iterator:
117117
# NOTE cpu comes last because we want to keep this order priorty during backend initialization
118-
return iter((self.unified, self.cuda, self.opencl, self.cpu))
118+
return iter((self.unified, self.cuda, self.oneapi, self.opencl, self.cpu))
119119

120120

121121
class Backend:

arrayfire_wrapper/lib/create_and_modify_array/create_array/identity.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
def identity(shape: tuple[int, ...], dtype: Dtype, /) -> AFArray:
1111
"""
12-
source:
12+
source: https://arrayfire.org/docs/group__data__func__identity.htm#gabd9b3de6813a9071ff2c6bc34a65589e
1313
"""
14-
out = AFArray(0)
14+
out = AFArray.create_null_pointer()
1515
c_shape = CShape(*shape)
1616
safe_call(_backend.clib.af_identity(ctypes.pointer(out), 4, c_shape.c_array, dtype.c_api_value))
1717
return out

0 commit comments

Comments
 (0)