Use random_attention_mask for TF tests (#16517)

* use random_attention_mask for TF tests

* Fix for TFCLIP test (for now).

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
Yih-Dar
2022-04-01 16:53:07 +02:00
committed by GitHub
parent 823dbf8a41
commit 2199382dfd
29 changed files with 62 additions and 57 deletions

View File

@@ -20,7 +20,7 @@ from transformers import FunnelConfig, is_tf_available
from transformers.testing_utils import require_tf
from ..test_configuration_common import ConfigTester
from ..test_modeling_tf_common import TFModelTesterMixin, ids_tensor
from ..test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
if is_tf_available():
@@ -111,7 +111,7 @@ class TFFunnelModelTester:
input_mask = None
if self.use_input_mask:
input_mask = ids_tensor([self.batch_size, self.seq_length], vocab_size=2)
input_mask = random_attention_mask([self.batch_size, self.seq_length])
token_type_ids = None
if self.use_token_type_ids: