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
3d62e895
Commit
3d62e895
authored
Jun 25, 2021
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 381540013
parent
c8a91782
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
official/nlp/keras_nlp/layers/position_embedding_test.py
official/nlp/keras_nlp/layers/position_embedding_test.py
+2
-2
No files found.
official/nlp/keras_nlp/layers/position_embedding_test.py
View file @
3d62e895
...
...
@@ -48,12 +48,12 @@ class PositionEmbeddingLayerTest(keras_parameterized.TestCase):
test_layer
=
position_embedding
.
PositionEmbedding
(
max_length
=
sequence_length
,
seq_axis
=
2
)
width
=
30
input_tensor
=
tf
.
keras
.
Input
(
shape
=
(
sequence_length
,
width
,
width
))
input_tensor
=
tf
.
keras
.
Input
(
shape
=
(
width
,
sequence_length
,
width
))
output_tensor
=
test_layer
(
input_tensor
)
# When using static positional embedding shapes, the output is expected
# to be the same as the input shape in all dimensions save batch.
expected_output_shape
=
[
None
,
sequence_length
,
width
,
width
]
expected_output_shape
=
[
None
,
width
,
sequence_length
,
width
]
self
.
assertEqual
(
expected_output_shape
,
output_tensor
.
shape
.
as_list
())
# The default output dtype for this layer should be tf.float32.
self
.
assertEqual
(
tf
.
float32
,
output_tensor
.
dtype
)
...
...
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