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
47b1e6aa
Commit
47b1e6aa
authored
Sep 08, 2020
by
Zhenyu Tan
Committed by
A. Unique TensorFlower
Sep 08, 2020
Browse files
Have BertEncoder ingest keras_nlp.SelfAttentionMask
PiperOrigin-RevId: 330623395
parent
dbbed31d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
official/nlp/modeling/networks/bert_encoder.py
official/nlp/modeling/networks/bert_encoder.py
+1
-1
No files found.
official/nlp/modeling/networks/bert_encoder.py
View file @
47b1e6aa
...
@@ -168,7 +168,7 @@ class BertEncoder(tf.keras.Model):
...
@@ -168,7 +168,7 @@ class BertEncoder(tf.keras.Model):
self
.
_transformer_layers
=
[]
self
.
_transformer_layers
=
[]
data
=
embeddings
data
=
embeddings
attention_mask
=
layers
.
SelfAttentionMask
()(
[
data
,
mask
]
)
attention_mask
=
keras_nlp
.
SelfAttentionMask
()(
data
,
mask
)
encoder_outputs
=
[]
encoder_outputs
=
[]
for
i
in
range
(
num_layers
):
for
i
in
range
(
num_layers
):
if
i
==
num_layers
-
1
and
output_range
is
not
None
:
if
i
==
num_layers
-
1
and
output_range
is
not
None
:
...
...
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