[python-arrayfire] 85/250: Add Array.__repr__()

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Mar 28 22:59:34 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 82c69c5882ebb2b5596fca9045549e53c39d9908
Author: Filipe Maia <filipe.c.maia at gmail.com>
Date:   Tue Sep 1 15:32:15 2015 +0200

    Add Array.__repr__()
---
 arrayfire/array.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arrayfire/array.py b/arrayfire/array.py
index 132e6e6..2c827be 100644
--- a/arrayfire/array.py
+++ b/arrayfire/array.py
@@ -495,6 +495,10 @@ class Array(BaseArray):
         ct_array, shape = self.to_ctype(row_major, True)
         return ctype_to_lists(ct_array, len(shape) - 1, shape)
 
+    def __repr__(self):
+        safe_call(backend.get().af_print_array(self.arr))
+        return '%s of dimensions %s' % (type(self), self.dims())
+
 def display(a):
     expr = inspect.stack()[1][-2]
     if (expr is not None):

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