Skip to content

Commit ed12077

Browse files
committed
Adding is_linear()
1 parent 9d89307 commit ed12077

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

arrayfire/array.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,14 @@ def is_bool(self):
642642
safe_call(backend.get().af_is_bool(ct.pointer(res), self.arr))
643643
return res.value
644644

645+
def is_linear(self):
646+
"""
647+
Check if all elements of the array are contiguous.
648+
"""
649+
res = ct.c_bool(False)
650+
safe_call(backend.get().af_is_linear(ct.pointer(res), self.arr))
651+
return res.value
652+
645653
def __add__(self, other):
646654
"""
647655
Return self + other.

0 commit comments

Comments
 (0)