From 436e929458464fba3b348e72fc63e4296c3a03df Mon Sep 17 00:00:00 2001 From: William Falcon Date: Wed, 24 Jul 2019 17:47:51 -0400 Subject: [PATCH] test memory printing --- pytorch_lightning/root_module/memory.py | 4 ++-- tests/test_models.py | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pytorch_lightning/root_module/memory.py b/pytorch_lightning/root_module/memory.py index 6f29b9ad..ffcf8572 100644 --- a/pytorch_lightning/root_module/memory.py +++ b/pytorch_lightning/root_module/memory.py @@ -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(): diff --git a/tests/test_models.py b/tests/test_models.py index 42c59738..f08ddf36 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -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()