From a6364445a4537bf3596148942be14959d9c773a1 Mon Sep 17 00:00:00 2001 From: Sijun He Date: Wed, 1 Feb 2023 12:40:03 +0800 Subject: [PATCH] rtol -> atol --- tests/transformers/bert/test_modeling.py | 2 +- tests/transformers/gpt/test_modeling.py | 2 +- tests/transformers/roberta/test_modeling.py | 2 +- tests/transformers/t5/test_modeling.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/transformers/bert/test_modeling.py b/tests/transformers/bert/test_modeling.py index 947a768d8efb..f3fdab2645d1 100644 --- a/tests/transformers/bert/test_modeling.py +++ b/tests/transformers/bert/test_modeling.py @@ -737,7 +737,7 @@ def test_bert_classes_from_local_dir(self, class_name, pytorch_class_name: str | np.allclose( paddle_logit.detach().cpu().reshape([-1])[:9].numpy(), torch_logit.detach().cpu().reshape([-1])[:9].numpy(), - rtol=1e-4, + atol=1e-3, ) ) diff --git a/tests/transformers/gpt/test_modeling.py b/tests/transformers/gpt/test_modeling.py index dae78494e6bc..fa2e8c1c2b2b 100644 --- a/tests/transformers/gpt/test_modeling.py +++ b/tests/transformers/gpt/test_modeling.py @@ -627,7 +627,7 @@ def test_gpt_classes_from_local_dir(self, paddle_class_name, pytorch_class_name: np.allclose( paddle_logit.detach().cpu().numpy().reshape([-1])[:9], torch_logit.detach().cpu().numpy().reshape([-1])[:9], - rtol=1e-3, + atol=1e-3, ) ) diff --git a/tests/transformers/roberta/test_modeling.py b/tests/transformers/roberta/test_modeling.py index b2dd1e06c642..ee665ec17a57 100644 --- a/tests/transformers/roberta/test_modeling.py +++ b/tests/transformers/roberta/test_modeling.py @@ -500,7 +500,7 @@ def test_roberta_classes_from_local_dir(self, class_name): np.allclose( paddle_logit.detach().cpu().reshape([-1])[:9].numpy(), torch_logit.detach().cpu().reshape([-1])[:9].numpy(), - rtol=1e-4, + atol=1e-3, ) ) diff --git a/tests/transformers/t5/test_modeling.py b/tests/transformers/t5/test_modeling.py index f8776dcf069e..4ecc7c5424d4 100644 --- a/tests/transformers/t5/test_modeling.py +++ b/tests/transformers/t5/test_modeling.py @@ -822,7 +822,7 @@ def test_t5_for_conditional_generation(self): np.allclose( paddle_logit.detach().cpu().reshape([-1])[:9].numpy(), torch_logit.detach().cpu().reshape([-1])[:9].numpy(), - rtol=1e-4, + atol=1e-3, ) )