Skip to content

Commit 5afc790

Browse files
authored
remove squeeze to avoid changing 1D-tensor to scalar (#749)
1 parent fe42fea commit 5afc790

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

paddlenlp/layers/crf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def forward(self, inputs, lengths):
145145
if self.with_start_stop_tag:
146146
# The last one step
147147
alpha += self.transitions[self.stop_idx].unsqueeze(0)
148-
norm_score = log_sum_exp(alpha, 1).squeeze(-1)
148+
norm_score = log_sum_exp(alpha, 1) #.squeeze(-1)
149149
return norm_score
150150

151151
def gold_score(self, inputs, labels, lengths):

0 commit comments

Comments
 (0)