Skip to content

Commit be3d22f

Browse files
Remove unused global variable (#4189)
* Remove unused global variable
1 parent c9b2d06 commit be3d22f

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

tests/test_rand_affine_grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from monai.transforms import RandAffineGrid
1919
from tests.utils import TEST_NDARRAYS, assert_allclose, is_tf32_env
2020

21-
_rtol = 1e-1 if is_tf32_env else 1e-4
21+
_rtol = 1e-1 if is_tf32_env() else 1e-4
2222

2323
TESTS = []
2424
for p in TEST_NDARRAYS:

tests/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,13 +586,11 @@ def _wrapper(*args, **kwargs):
586586

587587
def _cache_original_func(obj) -> None:
588588
"""cache the original function by name, so that the decorator doesn't shadow it."""
589-
global _original_funcs
590589
_original_funcs[obj.__name__] = obj
591590

592591

593592
def _del_original_func(obj):
594593
"""pop the original function from cache."""
595-
global _original_funcs
596594
_original_funcs.pop(obj.__name__, None)
597595
if torch.cuda.is_available(): # clean up the cached function
598596
torch.cuda.synchronize()

0 commit comments

Comments
 (0)