[python-arrayfire] 215/250: Adding offset()
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Mar 28 22:59:50 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 b726e89727d8a8230e19197a6d28a86834b993f4
Author: Filipe Maia <filipe.c.maia at gmail.com>
Date: Sun Feb 14 00:29:54 2016 +0100
Adding offset()
---
arrayfire/array.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arrayfire/array.py b/arrayfire/array.py
index 871d976..cb64659 100644
--- a/arrayfire/array.py
+++ b/arrayfire/array.py
@@ -491,6 +491,19 @@ class Array(BaseArray):
backend.get().af_get_raw_ptr(ct.pointer(ptr), self.arr)
return ptr.value
+ def offset(self):
+ """
+ Return the offset, of the first element relative to the raw pointer.
+
+ Returns
+ ------
+ offset : int
+ The offset in number of elements
+ """
+ offset = ct.c_longlong(0)
+ safe_call(backend.get().af_get_offset(ct.pointer(offset), self.arr))
+ return offset.value
+
def strides(self):
"""
Return the distance in bytes between consecutive elements for each dimension.
--
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