Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
33c01368
Commit
33c01368
authored
Oct 16, 2019
by
Rémi Louf
Browse files
remove Bert2Rnd test
parent
07520696
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
12 deletions
+1
-12
transformers/tests/modeling_bert_test.py
transformers/tests/modeling_bert_test.py
+1
-12
No files found.
transformers/tests/modeling_bert_test.py
View file @
33c01368
...
@@ -29,7 +29,7 @@ if is_torch_available():
...
@@ -29,7 +29,7 @@ if is_torch_available():
from
transformers
import
(
BertConfig
,
BertModel
,
BertForMaskedLM
,
from
transformers
import
(
BertConfig
,
BertModel
,
BertForMaskedLM
,
BertForNextSentencePrediction
,
BertForPreTraining
,
BertForNextSentencePrediction
,
BertForPreTraining
,
BertForQuestionAnswering
,
BertForSequenceClassification
,
BertForQuestionAnswering
,
BertForSequenceClassification
,
BertForTokenClassification
,
BertForMultipleChoice
,
Bert2Rnd
)
BertForTokenClassification
,
BertForMultipleChoice
)
from
transformers.modeling_bert
import
BERT_PRETRAINED_MODEL_ARCHIVE_MAP
from
transformers.modeling_bert
import
BERT_PRETRAINED_MODEL_ARCHIVE_MAP
else
:
else
:
pytestmark
=
pytest
.
mark
.
skip
(
"Require Torch"
)
pytestmark
=
pytest
.
mark
.
skip
(
"Require Torch"
)
...
@@ -255,17 +255,6 @@ class BertModelTest(CommonTestCases.CommonModelTester):
...
@@ -255,17 +255,6 @@ class BertModelTest(CommonTestCases.CommonModelTester):
[
self
.
batch_size
,
self
.
num_choices
])
[
self
.
batch_size
,
self
.
num_choices
])
self
.
check_loss_output
(
result
)
self
.
check_loss_output
(
result
)
def
create_and_check_bert2rnd
(
self
,
config
,
input_ids
,
token_type_ids
,
input_mask
,
sequence_labels
,
token_labels
,
choice_labels
):
config
.
num_choices
=
self
.
num_choices
model
=
Bert2Rnd
(
config
=
config
)
model
.
eval
()
bert2rnd_inputs_ids
=
input_ids
.
unsqueeze
(
1
).
expand
(
-
1
,
self
.
num_choices
,
-
1
).
contiguous
()
bert2rnd_token_type_ids
=
token_type_ids
.
unsqueeze
(
1
).
expand
(
-
1
,
self
.
num_choices
,
-
1
).
contiguous
()
bert2rnd_input_mask
=
input_mask
.
unsqueeze
(
1
).
expand
(
-
1
,
self
.
num_choices
,
-
1
).
contiguous
()
_
=
model
(
bert2rnd_inputs_ids
,
attention_mask
=
bert2rnd_input_mask
,
token_type_ids
=
bert2rnd_token_type_ids
)
def
prepare_config_and_inputs_for_common
(
self
):
def
prepare_config_and_inputs_for_common
(
self
):
config_and_inputs
=
self
.
prepare_config_and_inputs
()
config_and_inputs
=
self
.
prepare_config_and_inputs
()
(
config
,
input_ids
,
token_type_ids
,
input_mask
,
(
config
,
input_ids
,
token_type_ids
,
input_mask
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment