Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
ea86bef5
Commit
ea86bef5
authored
Aug 31, 2019
by
LysandreJik
Browse files
Check for None
parent
e0f867a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
pytorch_transformers/modeling_utils.py
pytorch_transformers/modeling_utils.py
+1
-1
No files found.
pytorch_transformers/modeling_utils.py
View file @
ea86bef5
...
...
@@ -327,7 +327,7 @@ class PreTrainedModel(nn.Module):
else
:
first_module
.
weight
=
second_module
.
weight
if
hasattr
(
first_module
,
'bias'
):
if
hasattr
(
first_module
,
'bias'
)
and
first_module
.
bias
is
not
None
:
first_module
.
bias
.
data
=
torch
.
nn
.
functional
.
pad
(
first_module
.
bias
.
data
,
(
0
,
first_module
.
weight
.
shape
[
0
]
-
first_module
.
bias
.
shape
[
0
]),
...
...
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