Skip to content

Commit 92ad83f

Browse files
committed
Rm unused global, nonlocal
1 parent 8c70570 commit 92ad83f

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

celldetection/util/timer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def start_timer(name, cuda=True, collect=True):
6969
Returns:
7070
7171
"""
72-
global TIMINGS
7372
if collect:
7473
gc.collect()
7574
if cuda:
@@ -80,7 +79,6 @@ def start_timer(name, cuda=True, collect=True):
8079

8180

8281
def stop_timer(name, cuda=True, verbose=True):
83-
global TIMINGS
8482
if cuda:
8583
torch.cuda.synchronize()
8684
delta = time() - TIMINGS[name]

celldetection_scripts/cpn_inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def oom_safe_concat_results_flat_(coll, new, target_device=None, fallback_device
175175

176176
# OOM safe concatenation
177177
def on_oom():
178-
nonlocal target_device, coll
178+
nonlocal target_device
179179
warn(f'Not enough memory. Moving data to {fallback_device} in order to continue.')
180180
target_device = fallback_device
181181
for k__, v__ in coll.items():

0 commit comments

Comments
 (0)