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
dd6b2e05
Commit
dd6b2e05
authored
Nov 11, 2019
by
Julien Chaumond
Browse files
whitespace
parent
d409aca3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
.gitignore
.gitignore
+2
-1
transformers/modeling_tf_utils.py
transformers/modeling_tf_utils.py
+7
-7
No files found.
.gitignore
View file @
dd6b2e05
...
@@ -137,4 +137,5 @@ examples/runs
...
@@ -137,4 +137,5 @@ examples/runs
serialization_dir
serialization_dir
# emacs
# emacs
*.*~
*.*~
\ No newline at end of file
debug.env
transformers/modeling_tf_utils.py
View file @
dd6b2e05
...
@@ -477,10 +477,10 @@ def shape_list(x):
...
@@ -477,10 +477,10 @@ def shape_list(x):
return
[
dynamic
[
i
]
if
s
is
None
else
s
for
i
,
s
in
enumerate
(
static
)]
return
[
dynamic
[
i
]
if
s
is
None
else
s
for
i
,
s
in
enumerate
(
static
)]
def
get_initializer
(
initializer_range
=
0.02
):
def
get_initializer
(
initializer_range
=
0.02
):
"""Creates a `tf.initializers.truncated_normal` with the given range.
"""Creates a `tf.initializers.truncated_normal` with the given range.
Args:
Args:
initializer_range: float, initializer range for stddev.
initializer_range: float, initializer range for stddev.
Returns:
Returns:
TruncatedNormal initializer with stddev = `initializer_range`.
TruncatedNormal initializer with stddev = `initializer_range`.
"""
"""
return
tf
.
keras
.
initializers
.
TruncatedNormal
(
stddev
=
initializer_range
)
return
tf
.
keras
.
initializers
.
TruncatedNormal
(
stddev
=
initializer_range
)
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