Skip to content

test: relax tolerance for TestResize.test_bounding_boxes_correctness#9468

Open
ddelgadovargas-cyber wants to merge 2 commits intopytorch:mainfrom
ddelgadovargas-cyber:test_relax_expectations
Open

test: relax tolerance for TestResize.test_bounding_boxes_correctness#9468
ddelgadovargas-cyber wants to merge 2 commits intopytorch:mainfrom
ddelgadovargas-cyber:test_relax_expectations

Conversation

@ddelgadovargas-cyber
Copy link
Copy Markdown

Relax tolerance for Resize transform unit tests. I'm having the following error with the default tolerance:

AssertionError: Tensor-likes are not close!

Mismatched elements: 1 / 5 (20.0%)
Greatest absolute difference: 1.049041748046875e-05 at index (0, 0) (up to 1e-05 allowed)
Greatest relative difference: inf at index (0, 0) (up to 1.3e-06 allowed)
self = <torchvision.test.test_transforms_v2.TestResize object at 0x72bf2e9107d0>
format = <BoundingBoxFormat.XYWHR: 'XYWHR'>, size = (12, 13)
use_max_size = False
fn = <function transform_cls_to_functional.<locals>.wrapper at 0x72bf2d625da0>

    @pytest.mark.parametrize("format", list(tv_tensors.BoundingBoxFormat))
    @pytest.mark.parametrize("size", OUTPUT_SIZES)
    @pytest.mark.parametrize("use_max_size", [True, False])
    @pytest.mark.parametrize("fn", [F.resize, transform_cls_to_functional(transforms.Resize)])
    def test_bounding_boxes_correctness(self, format, size, use_max_size, fn):
        if not (max_size_kwarg := self._make_max_size_kwarg(use_max_size=use_max_size, size=size)):
            return
    
        bounding_boxes = make_bounding_boxes(format=format, canvas_size=self.INPUT_SIZE)
    
        actual = fn(bounding_boxes, size=size, **max_size_kwarg)
        expected = self._reference_resize_bounding_boxes(bounding_boxes, format=format, size=size, **max_size_kwarg)
    
        self._check_output_size(bounding_boxes, actual, size=size, **max_size_kwarg)
>       torch.testing.assert_close(actual, expected)
E       AssertionError: Tensor-likes are not close!
E       
E       Mismatched elements: 1 / 5 (20.0%)
E       Greatest absolute difference: 1.049041748046875e-05 at index (0, 0) (up to 1e-05 allowed)
E       Greatest relative difference: inf at index (0, 0) (up to 1.3e-06 allowed)

[test/test_transforms_v2](http://test/test_transforms_v2).py:925: AssertionError

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Apr 6, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9468

Note: Links to docs will display an error until the docs builds have been completed.

❌ 10 New Failures

As of commit dd7041c with merge base 4e58149 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the cla signed label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant