From ed0f4f88b65c3ef97e8dabfc259ac6e591475046 Mon Sep 17 00:00:00 2001 From: ZacDiggum Date: Mon, 10 Oct 2016 12:25:34 +0200 Subject: [PATCH 1/3] Update interop.py add numpy u16 dtype --- arrayfire/interop.py | 1 + 1 file changed, 1 insertion(+) diff --git a/arrayfire/interop.py b/arrayfire/interop.py index e1a5d3b3d..dcead2341 100644 --- a/arrayfire/interop.py +++ b/arrayfire/interop.py @@ -31,6 +31,7 @@ 'f8' : Dtype.f64, 'b1' : Dtype.b8, 'u1' : Dtype.u8, + 'u2' : Dtype.u16, 'i4' : Dtype.s32, 's4' : Dtype.u32, 'i8' : Dtype.s64, From 9a7af639c1dafe81f169044facbc948c28082d2b Mon Sep 17 00:00:00 2001 From: ZacDiggum Date: Tue, 11 Oct 2016 10:17:56 +0200 Subject: [PATCH 2/3] Add files via upload --- arrayfire/interop.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arrayfire/interop.py b/arrayfire/interop.py index dcead2341..ebc4ea8c4 100644 --- a/arrayfire/interop.py +++ b/arrayfire/interop.py @@ -27,19 +27,19 @@ AF_NUMPY_FOUND=True - _nptype_to_aftype = {'f4' : Dtype.f32, + _nptype_to_aftype = {'b1' : Dtype.b8, + 'u1' : Dtype.u8, + 'u2' : Dtype.u16, + 'i2' : Dtype.s16, + 's4' : Dtype.u32, + 'i4' : Dtype.s32, + 'f4' : Dtype.f32, + 'c8' : Dtype.c32, + 's8' : Dtype.u64, + 'i8' : Dtype.s64, 'f8' : Dtype.f64, - 'b1' : Dtype.b8, - 'u1' : Dtype.u8, - 'u2' : Dtype.u16, - '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. From 284227f597577e45b87e62f68086bc1fbc85f518 Mon Sep 17 00:00:00 2001 From: ZacDiggum Date: Tue, 11 Oct 2016 10:20:18 +0200 Subject: [PATCH 3/3] added numpy u16 and s16 dtypes --- arrayfire/interop.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arrayfire/interop.py b/arrayfire/interop.py index ebc4ea8c4..e4cd3561d 100644 --- a/arrayfire/interop.py +++ b/arrayfire/interop.py @@ -28,15 +28,15 @@ AF_NUMPY_FOUND=True _nptype_to_aftype = {'b1' : Dtype.b8, - 'u1' : Dtype.u8, - 'u2' : Dtype.u16, - 'i2' : Dtype.s16, - 's4' : Dtype.u32, - 'i4' : Dtype.s32, - 'f4' : Dtype.f32, - 'c8' : Dtype.c32, - 's8' : Dtype.u64, - 'i8' : Dtype.s64, + 'u1' : Dtype.u8, + 'u2' : Dtype.u16, + 'i2' : Dtype.s16, + 's4' : Dtype.u32, + 'i4' : Dtype.s32, + 'f4' : Dtype.f32, + 'c8' : Dtype.c32, + 's8' : Dtype.u64, + 'i8' : Dtype.s64, 'f8' : Dtype.f64, 'c16' : Dtype.c64}