Skip to content

Commit fd0aca9

Browse files
vimalmanohardanpovey
authored andcommitted
[src] Fix nan issue in ctm times introduced in kaldi-asr#2972, thx: @vesis84 (kaldi-asr#2993)
1 parent f90a98c commit fd0aca9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lat/sausages.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ void MinimumBayesRisk::MbrDecode() {
6969
one_best_times_[i-2].second - one_best_times_[i-2].first;
7070
BaseFloat second_dur =
7171
one_best_times_[i-1].second - one_best_times_[i-1].first;
72-
BaseFloat mid = left + (right - left) * first_dur /
73-
(first_dur + second_dur);
72+
BaseFloat mid = first_dur > 0 ? left + (right - left) * first_dur /
73+
(first_dur + second_dur) : left;
7474
one_best_times_[i-2].first = left;
7575
one_best_times_[i-2].second = one_best_times_[i-1].first = mid;
7676
one_best_times_[i-1].second = right;

0 commit comments

Comments
 (0)