Unverified Commit a8732e09 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Fix device issue in...


Fix device issue in `SwiftFormerModelIntegrationTest::test_inference_image_classification_head` (#23435)

fix
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent 0f2c7382
...@@ -303,5 +303,5 @@ class SwiftFormerModelIntegrationTest(unittest.TestCase): ...@@ -303,5 +303,5 @@ class SwiftFormerModelIntegrationTest(unittest.TestCase):
expected_shape = torch.Size((1, 1000)) expected_shape = torch.Size((1, 1000))
self.assertEqual(outputs.logits.shape, expected_shape) self.assertEqual(outputs.logits.shape, expected_shape)
expected_slice = torch.tensor([[-2.1703e00, 2.1107e00, -2.0811e00]]) expected_slice = torch.tensor([[-2.1703e00, 2.1107e00, -2.0811e00]]).to(torch_device)
self.assertTrue(torch.allclose(outputs.logits[0, :3], expected_slice, atol=1e-4)) self.assertTrue(torch.allclose(outputs.logits[0, :3], expected_slice, atol=1e-4))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment