[python-arrayfire] 244/250: BUGFIX: Fixing the bug in constant for 64 bit int types

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Mar 28 22:59:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/master
in repository python-arrayfire.

commit 3c6c47c6b8968e4c686910c3880a824ff7226780
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Mon Mar 28 17:10:32 2016 -0400

    BUGFIX: Fixing the bug in constant for 64 bit int types
---
 arrayfire/array.py | 4 ++--
 arrayfire/util.py  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arrayfire/array.py b/arrayfire/array.py
index 74f78a6..d3f9e3b 100644
--- a/arrayfire/array.py
+++ b/arrayfire/array.py
@@ -85,10 +85,10 @@ def constant_array(val, d0, d1=None, d2=None, d3=None, dtype=Dtype.f32):
         safe_call(backend.get().af_constant_complex(ct.pointer(out), c_real, c_imag,
                                                     4, ct.pointer(dims), dtype))
     elif dtype.value == Dtype.s64.value:
-        c_val = c_dim_t(val.real)
+        c_val = ct.c_longlong(val.real)
         safe_call(backend.get().af_constant_long(ct.pointer(out), c_val, 4, ct.pointer(dims)))
     elif dtype.value == Dtype.u64.value:
-        c_val = c_dim_t(val.real)
+        c_val = ct.c_ulonglong(val.real)
         safe_call(backend.get().af_constant_ulong(ct.pointer(out), c_val, 4, ct.pointer(dims)))
     else:
         c_val = ct.c_double(val)
diff --git a/arrayfire/util.py b/arrayfire/util.py
index f5c37ee..a610fa9 100644
--- a/arrayfire/util.py
+++ b/arrayfire/util.py
@@ -15,7 +15,7 @@ def dim4(d0=1, d1=1, d2=1, d3=1):
     out = c_dim4(1, 1, 1, 1)
 
     for i, dim in enumerate((d0, d1, d2, d3)):
-        if (dim is not None): out[i] = dim
+        if (dim is not None): out[i] = c_dim_t(dim)
 
     return out
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-arrayfire.git



More information about the debian-science-commits mailing list