change print to logging (#457)

* change print to logging

* always use logging.info

* use f-strings

* update code style

* set logging configs

* remove unused code
This commit is contained in:
Ir1dXD
2019-11-05 08:43:21 -05:00
committed by William Falcon
parent 9a5307dc30
commit 5a9afb11cc
12 changed files with 56 additions and 41 deletions
+2 -1
View File
@@ -8,6 +8,7 @@ import subprocess
import numpy as np
import pandas as pd
import torch
import logging
class ModelSummary(object):
@@ -166,7 +167,7 @@ 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)):
print(type(obj), obj.size())
logging.info(type(obj), obj.size())
except Exception:
pass