use torch.testing.assertclose instead to get more details about error in cis (#35659)
* use torch.testing.assertclose instead to get more details about error in cis * fix * style * test_all * revert for I bert * fixes and updates * more image processing fixes * more image processors * fix mamba and co * style * less strick * ok I won't be strict * skip and be done * up
This commit is contained in:
@@ -317,7 +317,7 @@ class EsmModelIntegrationTest(TestCasePlus):
|
||||
expected_slice = torch.tensor(
|
||||
[[[8.9215, -10.5898, -6.4671], [-6.3967, -13.9114, -1.1212], [-7.7812, -13.9516, -3.7406]]]
|
||||
)
|
||||
self.assertTrue(torch.allclose(output[:, :3, :3], expected_slice, atol=1e-4))
|
||||
torch.testing.assert_close(output[:, :3, :3], expected_slice, rtol=1e-4, atol=1e-4)
|
||||
|
||||
def test_inference_no_head(self):
|
||||
with torch.no_grad():
|
||||
@@ -330,7 +330,7 @@ class EsmModelIntegrationTest(TestCasePlus):
|
||||
expected_slice = torch.tensor(
|
||||
[[[0.1444, 0.5413, 0.3248], [0.3034, 0.0053, 0.3108], [0.3228, -0.2499, 0.3415]]]
|
||||
)
|
||||
self.assertTrue(torch.allclose(output[:, :3, :3], expected_slice, atol=1e-4))
|
||||
torch.testing.assert_close(output[:, :3, :3], expected_slice, rtol=1e-4, atol=1e-4)
|
||||
|
||||
@require_bitsandbytes
|
||||
def test_inference_bitsandbytes(self):
|
||||
|
||||
@@ -282,4 +282,4 @@ class EsmModelIntegrationTest(TestCasePlus):
|
||||
input_ids = torch.tensor([[0, 6, 4, 13, 5, 4, 16, 12, 11, 7, 2]])
|
||||
position_outputs = model(input_ids)["positions"]
|
||||
expected_slice = torch.tensor([2.5828, 0.7993, -10.9334], dtype=torch.float32)
|
||||
self.assertTrue(torch.allclose(position_outputs[0, 0, 0, 0], expected_slice, atol=1e-4))
|
||||
torch.testing.assert_close(position_outputs[0, 0, 0, 0], expected_slice, rtol=1e-4, atol=1e-4)
|
||||
|
||||
Reference in New Issue
Block a user