[python-arrayfire] 167/250: Modifying eval to take multiple parameters

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Mar 28 22:59:45 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 3c4bfcdceac04fad20c4b419fc4acd7bdfbf1c4d
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Wed Dec 9 17:52:05 2015 -0500

    Modifying eval to take multiple parameters
---
 arrayfire/device.py | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/arrayfire/device.py b/arrayfire/device.py
index 814542a..5e879e4 100644
--- a/arrayfire/device.py
+++ b/arrayfire/device.py
@@ -105,15 +105,25 @@ def sync(device=None):
     dev = device if device is not None else get_device()
     safe_call(backend.get().af_sync(dev))
 
-def eval(A):
+def __eval(*args):
+    for A in args:
+        if isinstance(A, tuple):
+            __eval(*A)
+        if isinstance(A, list):
+            __eval(*A)
+        if isinstance(A, Array):
+            safe_call(backend.get().af_eval(A.arr))
+
+def eval(*args):
     """
     Evaluate the input
 
     Parameters
     -----------
-    A : af.Array
+    args : arguments to be evaluated
     """
-    safe_call(backend.get().af_eval(A.arr))
+
+    __eval(args)
 
 def device_mem_info():
     """
@@ -200,3 +210,5 @@ def unlock_device_ptr(a):
     """
     ptr = ct.c_void_p(0)
     safe_call(backend.get().af_unlock_device_ptr(a.arr))
+
+from .array import Array

-- 
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