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
4a233e5b
Unverified
Commit
4a233e5b
authored
Sep 26, 2019
by
Thomas Wolf
Committed by
GitHub
Sep 26, 2019
Browse files
Merge pull request #1315 from bryant1410/patch-1
Remove unnecessary use of FusedLayerNorm
parents
7c0f2d0a
98dd19b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
5 deletions
+1
-5
pytorch_transformers/modeling_bert.py
pytorch_transformers/modeling_bert.py
+1
-5
No files found.
pytorch_transformers/modeling_bert.py
View file @
4a233e5b
...
...
@@ -133,11 +133,7 @@ def swish(x):
ACT2FN
=
{
"gelu"
:
gelu
,
"relu"
:
torch
.
nn
.
functional
.
relu
,
"swish"
:
swish
}
try
:
from
apex.normalization.fused_layer_norm
import
FusedLayerNorm
as
BertLayerNorm
except
(
ImportError
,
AttributeError
)
as
e
:
logger
.
info
(
"Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex ."
)
BertLayerNorm
=
torch
.
nn
.
LayerNorm
BertLayerNorm
=
torch
.
nn
.
LayerNorm
class
BertEmbeddings
(
nn
.
Module
):
"""Construct the embeddings from word, position and token_type 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