Skip to content

Commit 239d97b

Browse files
ZacDiggumpavanky
authored andcommitted
Update interop.py (#103)
* Update interop.py add numpy u16 dtype * Add files via upload * added numpy u16 and s16 dtypes
1 parent 2cab1e7 commit 239d97b

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

arrayfire/interop.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,19 @@
2727

2828
AF_NUMPY_FOUND=True
2929

30-
_nptype_to_aftype = {'f4' : Dtype.f32,
30+
_nptype_to_aftype = {'b1' : Dtype.b8,
31+
'u1' : Dtype.u8,
32+
'u2' : Dtype.u16,
33+
'i2' : Dtype.s16,
34+
's4' : Dtype.u32,
35+
'i4' : Dtype.s32,
36+
'f4' : Dtype.f32,
37+
'c8' : Dtype.c32,
38+
's8' : Dtype.u64,
39+
'i8' : Dtype.s64,
3140
'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,
3941
'c16' : Dtype.c64}
4042

41-
4243
def np_to_af_array(np_arr):
4344
"""
4445
Convert numpy.ndarray to arrayfire.Array.

0 commit comments

Comments
 (0)