mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
test memory printing
This commit is contained in:
@@ -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():
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user