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:
@@ -329,7 +329,7 @@ class PatchTSTModelIntegrationTests(unittest.TestCase):
|
||||
[[[-0.0173]], [[-1.0379]], [[-0.1030]], [[0.3642]], [[0.1601]], [[-1.3136]], [[0.8780]]],
|
||||
device=torch_device,
|
||||
)
|
||||
self.assertTrue(torch.allclose(output[0, :7, :1, :1], expected_slice, atol=TOLERANCE))
|
||||
torch.testing.assert_close(output[0, :7, :1, :1], expected_slice, rtol=TOLERANCE, atol=TOLERANCE)
|
||||
|
||||
# Publishing of pretrained weights are under internal review. Pretrained model is not yet downloadable.
|
||||
def test_prediction_head(self):
|
||||
@@ -349,7 +349,7 @@ class PatchTSTModelIntegrationTests(unittest.TestCase):
|
||||
[[0.5142, 0.6928, 0.6118, 0.5724, -0.3735, -0.1336, -0.7124]],
|
||||
device=torch_device,
|
||||
)
|
||||
self.assertTrue(torch.allclose(output[0, :1, :7], expected_slice, atol=TOLERANCE))
|
||||
torch.testing.assert_close(output[0, :1, :7], expected_slice, rtol=TOLERANCE, atol=TOLERANCE)
|
||||
|
||||
def test_prediction_generation(self):
|
||||
model = PatchTSTForPrediction.from_pretrained("namctin/patchtst_etth1_forecast").to(torch_device)
|
||||
@@ -367,7 +367,7 @@ class PatchTSTModelIntegrationTests(unittest.TestCase):
|
||||
device=torch_device,
|
||||
)
|
||||
mean_prediction = outputs.sequences.mean(dim=1)
|
||||
self.assertTrue(torch.allclose(mean_prediction[0, -1:], expected_slice, atol=TOLERANCE))
|
||||
torch.testing.assert_close(mean_prediction[0, -1:], expected_slice, rtol=TOLERANCE, atol=TOLERANCE)
|
||||
|
||||
def test_regression_generation(self):
|
||||
model = PatchTSTForRegression.from_pretrained("ibm/patchtst-etth1-regression-distribution").to(torch_device)
|
||||
@@ -385,4 +385,4 @@ class PatchTSTModelIntegrationTests(unittest.TestCase):
|
||||
device=torch_device,
|
||||
)
|
||||
mean_prediction = outputs.sequences.mean(dim=1)
|
||||
self.assertTrue(torch.allclose(mean_prediction[-5:], expected_slice, rtol=TOLERANCE))
|
||||
torch.testing.assert_close(mean_prediction[-5:], expected_slice, rtol=TOLERANCE)
|
||||
|
||||
Reference in New Issue
Block a user