Update expected values (after switching to A10) - part 4 (#39189)
* fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -17,7 +17,7 @@ import collections
|
||||
import unittest
|
||||
|
||||
from transformers import FocalNetConfig
|
||||
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
|
||||
from transformers.testing_utils import Expectations, require_torch, require_vision, slow, torch_device
|
||||
from transformers.utils import cached_property, is_torch_available, is_vision_available
|
||||
|
||||
from ...test_backbone_common import BackboneTesterMixin
|
||||
@@ -425,8 +425,16 @@ class FocalNetModelIntegrationTest(unittest.TestCase):
|
||||
# verify the logits
|
||||
expected_shape = torch.Size((1, 1000))
|
||||
self.assertEqual(outputs.logits.shape, expected_shape)
|
||||
expected_slice = torch.tensor([0.2166, -0.4368, 0.2191]).to(torch_device)
|
||||
torch.testing.assert_close(outputs.logits[0, :3], expected_slice, rtol=1e-4, atol=1e-4)
|
||||
|
||||
expectations = Expectations(
|
||||
{
|
||||
(None, None): [0.2166, -0.4368, 0.2191],
|
||||
("cuda", 8): [0.2168, -0.4367, 0.2190],
|
||||
}
|
||||
)
|
||||
expected_slice = torch.tensor(expectations.get_expectation()).to(torch_device)
|
||||
|
||||
torch.testing.assert_close(outputs.logits[0, :3], expected_slice, rtol=2e-4, atol=2e-4)
|
||||
self.assertTrue(outputs.logits.argmax(dim=-1).item(), 281)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user