Skip to content

Commit 81abcde

Browse files
author
ranqiu
committed
Refine dot_product_attention
1 parent 2e1cd33 commit 81abcde

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

python/paddle/trainer_config_helpers/networks.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,10 +1476,8 @@ def dot_product_attention(encoded_sequence,
14761476
expand_as=encoded_sequence,
14771477
name='%s_expand' % name)
14781478

1479-
m = linear_comb_layer(
1480-
weights=expanded,
1481-
vectors=encoded_sequence,
1482-
name='%s_dot-product' % name)
1479+
m = dot_prod_layer(
1480+
input1=expanded, input2=encoded_sequence, name='%s_dot-product' % name)
14831481

14841482
attention_weight = fc_layer(
14851483
input=m,

0 commit comments

Comments
 (0)