Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Check if backend memory has been freed in check_leak_ndarray pytest f…
Browse files Browse the repository at this point in the history
…ixture (#19483)

* Fix check_leak_ndarray fixture for types (such as ndarray) with __hash__ NotImplementedError 
* Check if backend storage is freed in check_leak_ndarray pytest fixture
  • Loading branch information
leezu committed Nov 6, 2020
1 parent 31d6151 commit 77c4dbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/python/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ def has_array(element):
if element in seen:
return False
seen.add(element)
except (TypeError, ValueError): # unhashable
except (TypeError, ValueError, NotImplementedError): # unhashable
pass

if isinstance(element, mx.nd._internal.NDArrayBase):
return True
return element._alive # We only care about catching NDArray's that haven't been freed in the backend yet
elif isinstance(element, mx.sym._internal.SymbolBase):
return False
elif hasattr(element, '__dict__'):
Expand Down

0 comments on commit 77c4dbb

Please sign in to comment.