"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "bcaf566038fa3195f0817db1a36c806c70065a20"
Unverified Commit cc714d74 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Update `OneFormerModelIntegrationTest` expected values (#21295)



* update values

* update values

* update values

* Update tests/models/oneformer/test_modeling_oneformer.py
Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
parent 63b204ea
...@@ -451,7 +451,7 @@ class OneFormerModelIntegrationTest(unittest.TestCase): ...@@ -451,7 +451,7 @@ class OneFormerModelIntegrationTest(unittest.TestCase):
outputs = model(**inputs) outputs = model(**inputs)
expected_slice_hidden_state = torch.tensor( expected_slice_hidden_state = torch.tensor(
[[0.2724, 0.8287, 0.6025], [1.2706, 1.1252, 1.1445], [1.1357, 0.6150, 0.4185]] [[0.2723, 0.8280, 0.6026], [1.2699, 1.1257, 1.1444], [1.1344, 0.6153, 0.4177]]
).to(torch_device) ).to(torch_device)
self.assertTrue( self.assertTrue(
torch.allclose( torch.allclose(
...@@ -460,7 +460,7 @@ class OneFormerModelIntegrationTest(unittest.TestCase): ...@@ -460,7 +460,7 @@ class OneFormerModelIntegrationTest(unittest.TestCase):
) )
expected_slice_hidden_state = torch.tensor( expected_slice_hidden_state = torch.tensor(
[[1.0581, 1.2275, 1.2000], [1.1901, 1.2925, 1.2861], [1.1578, 1.2558, 1.3212]] [[1.0581, 1.2276, 1.2003], [1.1903, 1.2925, 1.2862], [1.158, 1.2559, 1.3216]]
).to(torch_device) ).to(torch_device)
self.assertTrue( self.assertTrue(
torch.allclose( torch.allclose(
...@@ -469,7 +469,7 @@ class OneFormerModelIntegrationTest(unittest.TestCase): ...@@ -469,7 +469,7 @@ class OneFormerModelIntegrationTest(unittest.TestCase):
) )
expected_slice_hidden_state = torch.tensor( expected_slice_hidden_state = torch.tensor(
[[3.0711, -1.1855, -5.1095], [3.5536, -3.2710, -5.2052], [2.6020, -4.3605, -4.1422]] [[3.0668, -1.1833, -5.1103], [3.344, -3.362, -5.1101], [2.6017, -4.3613, -4.1444]]
).to(torch_device) ).to(torch_device)
self.assertTrue( self.assertTrue(
torch.allclose( torch.allclose(
...@@ -495,7 +495,7 @@ class OneFormerModelIntegrationTest(unittest.TestCase): ...@@ -495,7 +495,7 @@ class OneFormerModelIntegrationTest(unittest.TestCase):
masks_queries_logits.shape, masks_queries_logits.shape,
(1, model.config.num_queries, inputs_shape[-2] // 4, (inputs_shape[-1] + 2) // 4), (1, model.config.num_queries, inputs_shape[-2] // 4, (inputs_shape[-1] + 2) // 4),
) )
expected_slice = [[[3.1215, 4.1250, 4.1106], [2.8183, 3.4623, 3.5512], [2.4550, 2.9841, 3.5081]]] expected_slice = [[[3.1848, 4.2141, 4.1993], [2.9000, 3.5721, 3.6603], [2.5358, 3.0883, 3.6168]]]
expected_slice = torch.tensor(expected_slice).to(torch_device) expected_slice = torch.tensor(expected_slice).to(torch_device)
self.assertTrue(torch.allclose(masks_queries_logits[0, 0, :3, :3], expected_slice, atol=TOLERANCE)) self.assertTrue(torch.allclose(masks_queries_logits[0, 0, :3, :3], expected_slice, atol=TOLERANCE))
# class_queries_logits # class_queries_logits
...@@ -505,7 +505,7 @@ class OneFormerModelIntegrationTest(unittest.TestCase): ...@@ -505,7 +505,7 @@ class OneFormerModelIntegrationTest(unittest.TestCase):
(1, model.config.num_queries, model.config.num_labels + 1), (1, model.config.num_queries, model.config.num_labels + 1),
) )
expected_slice = torch.tensor( expected_slice = torch.tensor(
[[3.0711, -1.1855, -5.1095], [3.5536, -3.2710, -5.2052], [2.6020, -4.3605, -4.1422]] [[3.0668, -1.1833, -5.1103], [3.3440, -3.3620, -5.1101], [2.6017, -4.3613, -4.1444]]
).to(torch_device) ).to(torch_device)
self.assertTrue(torch.allclose(class_queries_logits[0, :3, :3], expected_slice, atol=TOLERANCE)) self.assertTrue(torch.allclose(class_queries_logits[0, :3, :3], expected_slice, atol=TOLERANCE))
......
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