diff --git a/tests/test_load_image.py b/tests/test_load_image.py index dc0af5e97e..498b9972b4 100644 --- a/tests/test_load_image.py +++ b/tests/test_load_image.py @@ -217,7 +217,12 @@ def test_nibabel_reader(self, input_param, filenames, expected_shape): @SkipIfNoModule("kvikio") @parameterized.expand([TEST_CASE_GPU_1, TEST_CASE_GPU_2, TEST_CASE_GPU_3, TEST_CASE_GPU_4]) def test_nibabel_reader_gpu(self, input_param, filenames, expected_shape): - test_image = np.random.rand(128, 128, 128) + if torch.__version__.endswith("nv24.8"): + # related issue: https://github.com/Project-MONAI/MONAI/issues/8274 + # for this version, use randint test case to avoid the issue + test_image = torch.randint(0, 256, (128, 128, 128), dtype=torch.uint8).numpy() + else: + test_image = np.random.rand(128, 128, 128) with tempfile.TemporaryDirectory() as tempdir: for i, name in enumerate(filenames): filenames[i] = os.path.join(tempdir, name)