From a984560b19519d34c863e6b579adeb2fd6439c7f Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Wed, 27 Apr 2022 16:53:02 +0000 Subject: [PATCH 1/2] Remove unused global variable --- tests/utils.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index c4f9bd1b70..1a547fc2d2 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -586,13 +586,11 @@ def _wrapper(*args, **kwargs): def _cache_original_func(obj) -> None: """cache the original function by name, so that the decorator doesn't shadow it.""" - global _original_funcs _original_funcs[obj.__name__] = obj def _del_original_func(obj): """pop the original function from cache.""" - global _original_funcs _original_funcs.pop(obj.__name__, None) if torch.cuda.is_available(): # clean up the cached function torch.cuda.synchronize() From 0e69ecc564759c56af41c08cf0b417063cf3f280 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Wed, 27 Apr 2022 17:53:51 +0100 Subject: [PATCH 2/2] fixes typo Signed-off-by: Wenqi Li --- tests/test_rand_affine_grid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_rand_affine_grid.py b/tests/test_rand_affine_grid.py index 60ac40f468..722bafb0e5 100644 --- a/tests/test_rand_affine_grid.py +++ b/tests/test_rand_affine_grid.py @@ -18,7 +18,7 @@ from monai.transforms import RandAffineGrid from tests.utils import TEST_NDARRAYS, assert_allclose, is_tf32_env -_rtol = 1e-1 if is_tf32_env else 1e-4 +_rtol = 1e-1 if is_tf32_env() else 1e-4 TESTS = [] for p in TEST_NDARRAYS: