推理时添加softmax

pull/7741/head
zhiminzhang0830 2022-09-28 17:44:13 +08:00
parent b580fa0517
commit 154f42f1b0
1 changed files with 2 additions and 1 deletions

View File

@ -169,7 +169,8 @@ class AttentionLSTM(nn.Layer):
next_input = probs_step.argmax(axis=1)
targets = next_input
if not self.training:
probs = paddle.nn.functional.softmax(probs, axis=2)
return probs