[Tests] fix attention masks in Tests (#6621)

* fix distilbert

* fix typo
This commit is contained in:
Patrick von Platen
2020-08-20 19:23:47 +02:00
committed by GitHub
parent c9454507cf
commit 505f2d749e
15 changed files with 35 additions and 31 deletions

View File

@@ -20,7 +20,7 @@ from transformers import is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device
from .test_configuration_common import ConfigTester
from .test_modeling_common import ModelTesterMixin, ids_tensor
from .test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
if is_torch_available():
@@ -73,7 +73,7 @@ class XLMModelTester:
def prepare_config_and_inputs(self):
input_ids = ids_tensor([self.batch_size, self.seq_length], self.vocab_size)
input_mask = ids_tensor([self.batch_size, self.seq_length], 2).float()
input_mask = random_attention_mask([self.batch_size, self.seq_length])
input_lengths = None
if self.use_input_lengths: