From 07182b2e10382630a150c6a623ca31d88af4eb78 Mon Sep 17 00:00:00 2001 From: ivarflakstad <69173633+ivarflakstad@users.noreply.github.com> Date: Tue, 18 Feb 2025 16:04:19 +0100 Subject: [PATCH] GitModelIntegrationTest - flatten the expected slice tensor (#36260) Flatten the expected slice tensor --- tests/models/git/test_modeling_git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/models/git/test_modeling_git.py b/tests/models/git/test_modeling_git.py index 9912d9b6fe..473bbe6db6 100644 --- a/tests/models/git/test_modeling_git.py +++ b/tests/models/git/test_modeling_git.py @@ -549,7 +549,7 @@ class GitModelIntegrationTest(unittest.TestCase): self.assertEqual(outputs.sequences.shape, expected_shape) self.assertEqual(generated_caption, "two cats laying on a pink blanket") self.assertTrue(outputs.scores[-1].shape, expected_shape) - expected_slice = torch.tensor([[-0.8805, -0.8803, -0.8799]], device=torch_device) + expected_slice = torch.tensor([-0.8805, -0.8803, -0.8799], device=torch_device) torch.testing.assert_close(outputs.scores[-1][0, :3], expected_slice, rtol=1e-4, atol=1e-4) def test_visual_question_answering(self):