From e189b48f3c4b6de96e8fde16628873ecfcd6ba92 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Sat, 3 Apr 2021 11:59:25 +0100 Subject: [PATCH] skip warp tests before torch 18 Signed-off-by: Wenqi Li --- tests/test_warp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_warp.py b/tests/test_warp.py index 4ed1562b29..37a8551241 100644 --- a/tests/test_warp.py +++ b/tests/test_warp.py @@ -8,6 +8,7 @@ from monai.config.deviceconfig import USE_COMPILED from monai.networks.blocks.warp import Warp from monai.utils import GridSampleMode, GridSamplePadMode +from tests.utils import SkipIfBeforePyTorchVersion LOW_POWER_TEST_CASES = [ # run with BUILD_MONAI=1 to test csrc/resample, BUILD_MONAI=0 to test native grid_sample [ @@ -103,6 +104,7 @@ def test_ill_shape(self): with self.assertRaisesRegex(ValueError, ""): warp_layer(image=torch.arange(4).reshape((1, 1, 2, 2)).to(dtype=torch.float), ddf=torch.zeros(1, 2, 3, 3)) + @SkipIfBeforePyTorchVersion((1, 8)) def test_grad(self): for b in GridSampleMode: for p in GridSamplePadMode: