skip warp tests before torch 18
@@ -8,6 +8,7 @@ from torch.autograd import gradcheck
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 @@ class TestWarp(unittest.TestCase):
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:
