[python-arrayfire] 36/58: Adding tests for scan and scan_by_key

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Sep 28 13:57:07 UTC 2016


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

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

commit 48803553cb872d45f426b2299f161da26ce33a0f
Author: Pavan Yalamanchili <contact at pavanky.com>
Date:   Thu Sep 22 14:14:13 2016 -0700

    Adding tests for scan and scan_by_key
---
 arrayfire/tests/simple/algorithm.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arrayfire/tests/simple/algorithm.py b/arrayfire/tests/simple/algorithm.py
index f68e354..75ab814 100644
--- a/arrayfire/tests/simple/algorithm.py
+++ b/arrayfire/tests/simple/algorithm.py
@@ -16,6 +16,7 @@ def simple_algorithm(verbose = False):
     print_func   = _util.print_func(verbose)
 
     a = af.randu(3, 3)
+    k = af.constant(1, 3, 3, dtype=af.Dtype.u32)
 
     print_func(af.sum(a), af.product(a), af.min(a), af.max(a),
                af.count(a), af.any_true(a), af.all_true(a))
@@ -44,6 +45,12 @@ def simple_algorithm(verbose = False):
     display_func(af.accum(a, 0))
     display_func(af.accum(a, 1))
 
+    display_func(af.scan(a, 0, af.BINARYOP.ADD))
+    display_func(af.scan(a, 1, af.BINARYOP.MAX))
+
+    display_func(af.scan_by_key(k, a, 0, af.BINARYOP.ADD))
+    display_func(af.scan_by_key(k, a, 1, af.BINARYOP.MAX))
+
     display_func(af.sort(a, is_ascending=True))
     display_func(af.sort(a, is_ascending=False))
 

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