Skip to content

Commit 3537d10

Browse files
authored
Merge pull request #94 from arrayfire/bug-fixes
Bug fixes
2 parents af52c64 + 2196fe5 commit 3537d10

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

arrayfire/array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ def H(self):
593593
"""
594594
Return the hermitian transpose of the array
595595
"""
596-
return transpose(self, False)
596+
return transpose(self, True)
597597

598598
def dims(self):
599599
"""

arrayfire/interop.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@
2727

2828
AF_NUMPY_FOUND=True
2929

30+
_nptype_to_aftype = {'f4' : Dtype.f32,
31+
'f8' : Dtype.f64,
32+
'b1' : Dtype.b8,
33+
'u1' : Dtype.u8,
34+
'i4' : Dtype.s32,
35+
's4' : Dtype.u32,
36+
'i8' : Dtype.s64,
37+
's8' : Dtype.u64,
38+
'c8' : Dtype.c32,
39+
'c16' : Dtype.c64}
40+
41+
3042
def np_to_af_array(np_arr):
3143
"""
3244
Convert numpy.ndarray to arrayfire.Array.
@@ -42,7 +54,7 @@ def np_to_af_array(np_arr):
4254

4355
in_shape = np_arr.shape
4456
in_ptr = np_arr.ctypes.data_as(ct.c_void_p)
45-
in_dtype = np_arr.dtype.char
57+
in_dtype = _nptype_to_aftype[np_arr.dtype.str[1:]]
4658

4759
if (np_arr.flags['F_CONTIGUOUS']):
4860
return Array(in_ptr, in_shape, in_dtype)

arrayfire/lapack.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def qr(A):
9898
Q = Array()
9999
R = Array()
100100
T = Array()
101-
safe_call(backend.get().af_lu(ct.pointer(Q.arr), ct.pointer(R.arr), ct.pointer(T.arr), A.arr))
101+
safe_call(backend.get().af_qr(ct.pointer(Q.arr), ct.pointer(R.arr), ct.pointer(T.arr), A.arr))
102102
return Q,R,T
103103

104104
def qr_inplace(A):

0 commit comments

Comments
 (0)