"git@developer.sourcefind.cn:modelzoo/resnet50_tensorflow.git" did not exist on "fad183f87352e12b0fc6629de875b1cb1054f558"
Commit 7ae450a1 authored by Zhenyu Tan's avatar Zhenyu Tan Committed by A. Unique TensorFlower
Browse files

Have BertEncoder ingest keras_nlp.SelfAttentionMask

PiperOrigin-RevId: 330623395
parent 2f737e1e
...@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment