Skip to content

Commit

Permalink
Fix online nbest decoding (#1282)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkufool committed Apr 29, 2024
1 parent 8905c6b commit a5cef5d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions k2/csrc/intersect_dense_pruned.cu
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,6 @@ class MultiGraphDenseIntersectPruned {
ArcInfo old_ai = arcs_data[old_idx012];
// Only 1 state (the final state) in next frame, so idx1 is always 0.
old_ai.u.dest_info_state_idx1 = 0;
// The final arcs we are adding for online decoding partial should not
// map to any real arc in a_fsas.
// We add these final arcs for the purpose of making the partial lattice
// a valid Fsa.
old_ai.a_fsas_arc_idx012 = -1;
new_arcs_data[new_idx012] = old_ai;
});

Expand Down Expand Up @@ -635,6 +630,7 @@ class MultiGraphDenseIntersectPruned {
if (t == final_t - 1 && arc_label != -1) {
if (allow_partial) {
arc.label = -1;
arc_info.a_fsas_arc_idx012 = -1;
} else {
// Unreachable code.
K2_LOG(FATAL) <<
Expand Down

0 comments on commit a5cef5d

Please sign in to comment.