test memory printing

This commit is contained in:
William Falcon
2019-07-24 17:47:51 -04:00
parent 7f420c0cc2
commit 436e929458
2 changed files with 2 additions and 4 deletions
+2 -2
View File
@@ -152,7 +152,7 @@ class ModelSummary(object):
self.make_summary()
def print_mem_stack():
def print_mem_stack(): # pragma: no cover
for obj in gc.get_objects():
try:
if torch.is_tensor(obj) or (hasattr(obj, 'data') and torch.is_tensor(obj.data)):
@@ -161,7 +161,7 @@ def print_mem_stack():
pass
def count_mem_items():
def count_mem_items(): # pragma: no cover
nb_params = 0
nb_tensors = 0
for obj in gc.get_objects():
-2
View File
@@ -130,8 +130,6 @@ def test_multi_gpu_model_dp():
run_gpu_model_test(trainer_options, model, hparams)
# test memory helper functions
memory.count_mem_items()
memory.print_mem_stack()
memory.get_gpu_memory_map()