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
OpenDAS
Megatron-LM
Commits
bb7c638f
Commit
bb7c638f
authored
Jul 29, 2020
by
Boris Fomitchev
Browse files
Restored @script for openai_gelu
Signed-off-by:
Boris Fomitchev
<
bfomitchev@nvidia.com
>
parent
fe794c5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
megatron/model/utils.py
megatron/model/utils.py
+1
-0
No files found.
megatron/model/utils.py
View file @
bb7c638f
...
@@ -48,6 +48,7 @@ def get_linear_layer(rows, columns, init_method):
...
@@ -48,6 +48,7 @@ def get_linear_layer(rows, columns, init_method):
layer
.
bias
.
zero_
()
layer
.
bias
.
zero_
()
return
layer
return
layer
@
torch
.
jit
.
script
def
gelu_impl
(
x
):
def
gelu_impl
(
x
):
"""OpenAI's gelu implementation."""
"""OpenAI's gelu implementation."""
return
0.5
*
x
*
(
1.0
+
torch
.
tanh
(
0.7978845608028654
*
x
*
return
0.5
*
x
*
(
1.0
+
torch
.
tanh
(
0.7978845608028654
*
x
*
...
...
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