Skip to content

Commit 4ad12a0

Browse files
author
ranqiu
committed
Fix bugs of dot-product attention
1 parent 3f1062d commit 4ad12a0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/paddle/trainer_config_helpers/networks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,11 +1457,13 @@ def dot_product_attention(encoded_sequence,
14571457

14581458
expanded = expand_layer(
14591459
input=transformed_state,
1460-
expanded_as=encoded_sequence,
1460+
expand_as=encoded_sequence,
14611461
name='%s_expand' % name)
14621462

14631463
m = linear_comb_layer(
1464-
weights=expanded, vectors=encoded_sequence, name='%s_dot-product')
1464+
weights=expanded,
1465+
vectors=encoded_sequence,
1466+
name='%s_dot-product' % name)
14651467

14661468
attention_weight = fc_layer(
14671469
input=m,

0 commit comments

Comments
 (0)