From 9eb0a8c41bcb0f8d95c8c7e99ea9d40d0835b7dc Mon Sep 17 00:00:00 2001 From: Yiheng Wang <68361391+yiheng-wang-nv@users.noreply.github.com> Date: Mon, 6 Jan 2025 18:45:21 +0800 Subject: [PATCH] 8274 Relax gpu load check (#8282) Related to #8274 , this PR is used to check potential issues. When I used the same environment as the nightly test, the error was not reproduced. Therefore, I hope the new change can show more information about the error. ### Description A few sentences describing the changes proposed in this pull request. ### Types of changes - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Yiheng Wang --- tests/test_load_image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_load_image.py b/tests/test_load_image.py index aa8b71b7fa..dc0af5e97e 100644 --- a/tests/test_load_image.py +++ b/tests/test_load_image.py @@ -233,7 +233,7 @@ def test_nibabel_reader_gpu(self, input_param, filenames, expected_shape): input_param_cpu = input_param.copy() input_param_cpu["to_gpu"] = False result_cpu = LoadImage(image_only=True, **input_param_cpu)(filenames) - self.assertTrue(torch.allclose(result_cpu, result.cpu(), atol=1e-6)) + assert_allclose(result_cpu, result.cpu(), atol=1e-6) @parameterized.expand([TEST_CASE_6, TEST_CASE_7, TEST_CASE_8, TEST_CASE_8_1, TEST_CASE_9]) def test_itk_reader(self, input_param, filenames, expected_shape):