Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arrayfire/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def H(self):
"""
Return the hermitian transpose of the array
"""
return transpose(self, False)
return transpose(self, True)

def dims(self):
"""
Expand Down
14 changes: 13 additions & 1 deletion arrayfire/interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@

AF_NUMPY_FOUND=True

_nptype_to_aftype = {'f4' : Dtype.f32,
'f8' : Dtype.f64,
'b1' : Dtype.b8,
'u1' : Dtype.u8,
'i4' : Dtype.s32,
's4' : Dtype.u32,
'i8' : Dtype.s64,
's8' : Dtype.u64,
'c8' : Dtype.c32,
'c16' : Dtype.c64}


def np_to_af_array(np_arr):
"""
Convert numpy.ndarray to arrayfire.Array.
Expand All @@ -41,7 +53,7 @@ def np_to_af_array(np_arr):

in_shape = np_arr.shape
in_ptr = np_arr.ctypes.data_as(ct.c_void_p)
in_dtype = np_arr.dtype.char
in_dtype = _nptype_to_aftype[np_arr.dtype.str[1:]]

if (np_arr.flags['F_CONTIGUOUS']):
return Array(in_ptr, in_shape, in_dtype)
Expand Down
2 changes: 1 addition & 1 deletion arrayfire/lapack.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def qr(A):
Q = Array()
R = Array()
T = Array()
safe_call(backend.get().af_lu(ct.pointer(Q.arr), ct.pointer(R.arr), ct.pointer(T.arr), A.arr))
safe_call(backend.get().af_qr(ct.pointer(Q.arr), ct.pointer(R.arr), ct.pointer(T.arr), A.arr))
return Q,R,T

def qr_inplace(A):
Expand Down