Improve test_pt_tf_model_equivalence on PT side (#16731)

* Update test_pt_tf_model_equivalence on PT side

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
Yih-Dar
2022-04-19 21:13:27 +02:00
committed by GitHub
parent 3dd57b15c5
commit e6d23a4b9b
5 changed files with 255 additions and 602 deletions

View File

@@ -565,8 +565,7 @@ class TFModelTesterMixin:
# Output all for aggressive testing
config.output_hidden_states = True
if self.has_attentions:
config.output_attentions = True
config.output_attentions = self.has_attentions
# Make sure no sequence has all zeros as attention mask, otherwise some tests fail due to the inconsistency
# of the usage `1e-4`, `1e-9`, `1e-30`, `-inf`.