[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():
@@ -71,7 +71,7 @@ class AlbertModelTester:
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: