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
4140da21
Commit
4140da21
authored
Jun 24, 2020
by
Hongkun Yu
Committed by
A. Unique TensorFlower
Jun 24, 2020
Browse files
Multichannel attention: Override _build_attention method instead of build()
PiperOrigin-RevId: 318208409
parent
24310ad1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
official/nlp/modeling/layers/multi_channel_attention.py
official/nlp/modeling/layers/multi_channel_attention.py
+2
-2
No files found.
official/nlp/modeling/layers/multi_channel_attention.py
View file @
4140da21
...
...
@@ -117,8 +117,8 @@ class MultiChannelAttention(attention.MultiHeadAttention):
cross-attention target sequences.
"""
def
build
(
self
,
input_shape
):
super
(
MultiChannelAttention
,
self
).
build
(
input_shape
)
def
_
build
_attention
(
self
,
qkv_rank
):
super
(
MultiChannelAttention
,
self
).
_
build
_attention
(
qkv_rank
)
self
.
_masked_softmax
=
masked_softmax
.
MaskedSoftmax
(
mask_expansion_axes
=
[
2
])
def
call
(
self
,
inputs
,
attention_mask
=
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