Refactor collections and fstrings (#7821)
* Update torch_utils.py * Additional code refactoring * tuples to sets * Cleanup
This commit is contained in:
1 parent
3356f2609c
commit
f00071416f
9 files changed
+58
-63
No files matched your search
+1
-1
@@ -84,7 +84,7 @@ def set_logging(name=None, verbose=VERBOSE):
|
||||
for h in logging.root.handlers:
|
||||
logging.root.removeHandler(h) # remove all handlers associated with the root logger object
|
||||
rank = int(os.getenv('RANK', -1)) # rank in world for Multi-GPU trainings
|
||||
level = logging.INFO if (verbose and rank in (-1, 0)) else logging.WARNING
|
||||
level = logging.INFO if verbose and rank in {-1, 0} else logging.WARNING
|
||||
log = logging.getLogger(name)
|
||||
log.setLevel(level)
|
||||
handler = logging.StreamHandler()
|
||||
|
||||
Reference in new issue
Block a user