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
3dae7a77
Commit
3dae7a77
authored
Nov 19, 2020
by
Chen Chen
Committed by
A. Unique TensorFlower
Nov 19, 2020
Browse files
Fix typo last_enocder_output -> last_encoder_output
PiperOrigin-RevId: 343410095
parent
babf9ad8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
official/nlp/keras_nlp/encoders/bert_encoder.py
official/nlp/keras_nlp/encoders/bert_encoder.py
+2
-2
No files found.
official/nlp/keras_nlp/encoders/bert_encoder.py
View file @
3dae7a77
...
...
@@ -169,11 +169,11 @@ class BertEncoder(tf.keras.Model):
data
=
layer
([
data
,
attention_mask
])
encoder_outputs
.
append
(
data
)
last_en
o
cder_output
=
encoder_outputs
[
-
1
]
last_enc
o
der_output
=
encoder_outputs
[
-
1
]
# Applying a tf.slice op (through subscript notation) to a Keras tensor
# like this will create a SliceOpLambda layer. This is better than a Lambda
# layer with Python code, because that is fundamentally less portable.
first_token_tensor
=
last_en
o
cder_output
[:,
0
,
:]
first_token_tensor
=
last_enc
o
der_output
[:,
0
,
:]
pooler_layer
=
tf
.
keras
.
layers
.
Dense
(
units
=
hidden_size
,
activation
=
'tanh'
,
...
...
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