[python-arrayfire] 11/250: TEST: Simple test for data functions

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Mar 28 22:59:25 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 2be3cbf36cf8145f5f8ee1701b493b2b5c4a4aef
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date:   Fri Jun 19 16:56:44 2015 -0400

    TEST: Simple test for data functions
---
 tests/simple_data.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/tests/simple_data.py b/tests/simple_data.py
new file mode 100644
index 0000000..9381671
--- /dev/null
+++ b/tests/simple_data.py
@@ -0,0 +1,54 @@
+#!/usr/bin/python
+import arrayfire as af
+
+af.print_array(af.constant(100, 3,3, dtype=af.f32))
+af.print_array(af.constant(25, 3,3, dtype=af.c32))
+af.print_array(af.constant(2**50, 3,3, dtype=af.s64))
+af.print_array(af.constant(2+3j, 3,3))
+af.print_array(af.constant(3+5j, 3,3, dtype=af.c32))
+
+af.print_array(af.range(3, 3))
+af.print_array(af.iota(3, 3, tile_dims=(2,2)))
+
+af.print_array(af.randu(3, 3, 1, 2))
+af.print_array(af.randu(3, 3, 1, 2, af.b8))
+af.print_array(af.randu(3, 3, dtype=af.c32))
+
+af.print_array(af.randn(3, 3, 1, 2))
+af.print_array(af.randn(3, 3, dtype=af.c32))
+
+af.set_seed(1024)
+assert(af.get_seed() == 1024)
+
+af.print_array(af.identity(3, 3, 1, 2, af.b8))
+af.print_array(af.identity(3, 3, dtype=af.c32))
+
+a = af.randu(3, 4)
+b = af.diag(a, extract=True)
+c = af.diag(a, 1, extract=True)
+
+af.print_array(a)
+af.print_array(b)
+af.print_array(c)
+
+af.print_array(af.diag(b, extract = False))
+af.print_array(af.diag(c, 1, extract = False))
+
+af.print_array(af.tile(a, 2, 2))
+
+af.print_array(af.reorder(a, 1, 0))
+
+af.print_array(af.shift(a, -1, 1))
+
+af.print_array(af.moddims(a, 6, 2))
+
+af.print_array(af.flat(a))
+
+af.print_array(af.flip(a, 0))
+af.print_array(af.flip(a, 1))
+
+af.print_array(af.lower(a, False))
+af.print_array(af.lower(a, True))
+
+af.print_array(af.upper(a, False))
+af.print_array(af.upper(a, True))

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