Skip to content

Commit

Permalink
Added docstring for get_all_arrays_in_memory (ivy-llc#10463)
Browse files Browse the repository at this point in the history
  • Loading branch information
Killua7362 authored Feb 14, 2023
1 parent 6ea1994 commit 1667472
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion ivy/functional/ivy/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -2178,7 +2178,25 @@ def stable_pow(

@handle_exceptions
def get_all_arrays_in_memory() -> List[Union[ivy.Array, ivy.NativeArray]]:
"""Gets all arrays which are currently alive."""
"""
Gets all arrays which are currently alive.
Returns
-------
ret
All arrays which are alive.
Examples
--------
>>> ivy.get_all_arrays_in_memory()
[]
>>> x = ivy.get_all_arrays_in_memory()
>>> x
[]
>>> y = ivy.array([0, 1, 2])
>>> x
[ivy.array([0, 1, 2])]
"""
all_arrays = list()
for obj in gc.get_objects():
try:
Expand Down

0 comments on commit 1667472

Please sign in to comment.