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
d97b4176
Commit
d97b4176
authored
Jun 19, 2020
by
Lysandre
Browse files
Correct device assignment
parent
9a3f9108
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/transformers/modeling_mobilebert.py
src/transformers/modeling_mobilebert.py
+2
-0
No files found.
src/transformers/modeling_mobilebert.py
View file @
d97b4176
...
...
@@ -894,6 +894,7 @@ class MobileBertForPreTraining(MobileBertPreTrainedModel):
]
resized_dense
.
weight
.
data
[...,
:
self
.
cls
.
predictions
.
dense
.
weight
.
data
.
shape
[
1
]]
=
kept_data
self
.
cls
.
predictions
.
dense
=
resized_dense
self
.
cls
.
predictions
.
dense
.
to
(
self
.
device
)
if
output_embeddings
is
not
None
:
self
.
_tie_or_clone_weights
(
output_embeddings
,
self
.
get_input_embeddings
())
...
...
@@ -1008,6 +1009,7 @@ class MobileBertForMaskedLM(MobileBertPreTrainedModel):
]
resized_dense
.
weight
.
data
[...,
:
self
.
cls
.
predictions
.
dense
.
weight
.
data
.
shape
[
1
]]
=
kept_data
self
.
cls
.
predictions
.
dense
=
resized_dense
self
.
cls
.
predictions
.
dense
.
to
(
self
.
device
)
if
output_embeddings
is
not
None
:
self
.
_tie_or_clone_weights
(
output_embeddings
,
self
.
get_input_embeddings
())
...
...
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