Skip to content

Commit 6c9a4db

Browse files
shyams2pavanky
authored andcommitted
Added len() method
1 parent a9031fb commit 6c9a4db

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arrayfire/array.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,9 @@ def elements(self):
631631
safe_call(backend.get().af_get_elements(c_pointer(num), self.arr))
632632
return num.value
633633

634+
def __len__(self):
635+
return(self.elements())
636+
634637
def allocated(self):
635638
"""
636639
Returns the number of bytes allocated by the memory manager for the array.

0 commit comments

Comments
 (0)