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
ModelZoo
ResNet50_tensorflow
Commits
bd64315e
"git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "0035e31af87c6cc62cde5d6cd0f22d36131ff62e"
Unverified
Commit
bd64315e
authored
Mar 31, 2020
by
Yichao 'Peak' Ji
Committed by
GitHub
Mar 31, 2020
Browse files
Minor code style updates
parent
c93ac621
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
official/nlp/modeling/layers/position_embedding.py
official/nlp/modeling/layers/position_embedding.py
+2
-7
No files found.
official/nlp/modeling/layers/position_embedding.py
View file @
bd64315e
...
@@ -111,14 +111,9 @@ class PositionEmbedding(tf.keras.layers.Layer):
...
@@ -111,14 +111,9 @@ class PositionEmbedding(tf.keras.layers.Layer):
def
call
(
self
,
inputs
):
def
call
(
self
,
inputs
):
"""Implements call() for the layer."""
"""Implements call() for the layer."""
input_shape
=
tf_utils
.
get_shape_list
(
inputs
,
expected_rank
=
3
)
if
self
.
_use_dynamic_slicing
:
if
self
.
_use_dynamic_slicing
:
input_shape
=
tf_utils
.
get_shape_list
(
inputs
,
expected_rank
=
3
)
position_embeddings
=
self
.
_position_embeddings
[:
input_shape
[
1
],
:]
seq_length
=
input_shape
[
1
]
width
=
input_shape
[
2
]
position_embeddings
=
tf
.
slice
(
self
.
_position_embeddings
,
[
0
,
0
],
[
seq_length
,
width
])
else
:
else
:
position_embeddings
=
self
.
_position_embeddings
position_embeddings
=
self
.
_position_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