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
2f174642
Commit
2f174642
authored
Nov 11, 2019
by
Julien Chaumond
Browse files
[common attributes] Slightly sharper test coverage
parent
9d2398fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
transformers/tests/modeling_common_test.py
transformers/tests/modeling_common_test.py
+8
-2
No files found.
transformers/tests/modeling_common_test.py
View file @
2f174642
...
...
@@ -468,9 +468,15 @@ class CommonTestCases:
for
model_class
in
self
.
all_model_classes
:
model
=
model_class
(
config
)
model
.
get_input_embeddings
()
self
.
assertIsInstance
(
model
.
get_input_embeddings
(),
torch
.
nn
.
Embedding
)
model
.
set_input_embeddings
(
torch
.
nn
.
Embedding
(
10
,
10
))
model
.
get_output_embeddings
()
x
=
model
.
get_output_embeddings
()
self
.
assertTrue
(
x
is
None
or
isinstance
(
x
,
torch
.
nn
.
Linear
)
)
def
test_tie_model_weights
(
self
):
if
not
self
.
test_torchscript
:
...
...
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