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

Use larger atol in `torch.allclose` for some tests (#21966)



Use larger atol
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent 64d95c44
...@@ -2497,7 +2497,7 @@ class ModelTesterMixin: ...@@ -2497,7 +2497,7 @@ class ModelTesterMixin:
torch.manual_seed(0) torch.manual_seed(0)
new_output = new_model(**inputs_dict_class) new_output = new_model(**inputs_dict_class)
self.assertTrue(torch.allclose(base_output[0], new_output[0])) self.assertTrue(torch.allclose(base_output[0], new_output[0], atol=1e-5))
@require_accelerate @require_accelerate
@mark.accelerate_tests @mark.accelerate_tests
...@@ -2533,7 +2533,7 @@ class ModelTesterMixin: ...@@ -2533,7 +2533,7 @@ class ModelTesterMixin:
torch.manual_seed(0) torch.manual_seed(0)
new_output = new_model(**inputs_dict_class) new_output = new_model(**inputs_dict_class)
self.assertTrue(torch.allclose(base_output[0], new_output[0])) self.assertTrue(torch.allclose(base_output[0], new_output[0], atol=1e-5))
@require_accelerate @require_accelerate
@mark.accelerate_tests @mark.accelerate_tests
...@@ -2569,7 +2569,7 @@ class ModelTesterMixin: ...@@ -2569,7 +2569,7 @@ class ModelTesterMixin:
torch.manual_seed(0) torch.manual_seed(0)
new_output = new_model(**inputs_dict_class) new_output = new_model(**inputs_dict_class)
self.assertTrue(torch.allclose(base_output[0], new_output[0])) self.assertTrue(torch.allclose(base_output[0], new_output[0], atol=1e-5))
def test_problem_types(self): def test_problem_types(self):
config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
......
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