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
237a5435
Commit
237a5435
authored
Jul 31, 2020
by
xinliupitt
Browse files
remove layer creation
parent
43fb3341
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
34 deletions
+0
-34
official/nlp/modeling/layers/on_device_embedding_test.py
official/nlp/modeling/layers/on_device_embedding_test.py
+0
-34
No files found.
official/nlp/modeling/layers/on_device_embedding_test.py
View file @
237a5435
...
@@ -193,40 +193,6 @@ class OnDeviceEmbeddingTest(keras_parameterized.TestCase):
...
@@ -193,40 +193,6 @@ class OnDeviceEmbeddingTest(keras_parameterized.TestCase):
output
=
model
.
predict
(
input_data
)
output
=
model
.
predict
(
input_data
)
self
.
assertEqual
(
tf
.
float16
,
output
.
dtype
)
self
.
assertEqual
(
tf
.
float16
,
output
.
dtype
)
def
test_use_scale_layer_creation
(
self
):
vocab_size
=
31
embedding_width
=
27
test_layer
=
on_device_embedding
.
OnDeviceEmbedding
(
vocab_size
=
vocab_size
,
embedding_width
=
embedding_width
,
use_scale
=
True
)
# Create a 2-dimensional input (the first dimension is implicit).
sequence_length
=
23
input_tensor
=
tf
.
keras
.
Input
(
shape
=
(
sequence_length
),
dtype
=
tf
.
int32
)
output_tensor
=
test_layer
(
input_tensor
)
# The output should be the same as the input, save that it has an extra
# embedding_width dimension on the end.
expected_output_shape
=
[
None
,
sequence_length
,
embedding_width
]
self
.
assertEqual
(
expected_output_shape
,
output_tensor
.
shape
.
as_list
())
self
.
assertEqual
(
output_tensor
.
dtype
,
tf
.
float32
)
def
test_use_scale_layer_creation_with_mixed_precision
(
self
):
vocab_size
=
31
embedding_width
=
27
policy
=
tf
.
keras
.
mixed_precision
.
experimental
.
Policy
(
"mixed_float16"
)
test_layer
=
on_device_embedding
.
OnDeviceEmbedding
(
vocab_size
=
vocab_size
,
embedding_width
=
embedding_width
,
dtype
=
policy
,
use_scale
=
True
)
# Create a 2-dimensional input (the first dimension is implicit).
sequence_length
=
23
input_tensor
=
tf
.
keras
.
Input
(
shape
=
(
sequence_length
),
dtype
=
tf
.
int32
)
output_tensor
=
test_layer
(
input_tensor
)
# The output should be the same as the input, save that it has an extra
# embedding_width dimension on the end.
expected_output_shape
=
[
None
,
sequence_length
,
embedding_width
]
self
.
assertEqual
(
expected_output_shape
,
output_tensor
.
shape
.
as_list
())
self
.
assertEqual
(
output_tensor
.
dtype
,
tf
.
float16
)
def
test_use_scale_layer_invocation
(
self
):
def
test_use_scale_layer_invocation
(
self
):
vocab_size
=
31
vocab_size
=
31
embedding_width
=
27
embedding_width
=
27
...
...
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