From 59ac8bfc70a0062bc32b341e2bd1089f61a1011c Mon Sep 17 00:00:00 2001 From: emilyluj <49872352+emilyluj@users.noreply.github.com> Date: Thu, 9 Feb 2023 18:32:03 +0800 Subject: [PATCH] fix mmi graph compiler bug. (#895) --- icefall/mmi_graph_compiler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/icefall/mmi_graph_compiler.py b/icefall/mmi_graph_compiler.py index 9f680f83d..600f09f2b 100644 --- a/icefall/mmi_graph_compiler.py +++ b/icefall/mmi_graph_compiler.py @@ -74,7 +74,9 @@ class MmiTrainingGraphCompiler(object): # CAUTION: The following line is crucial. # Arcs entering the back-off state have label equal to #0. # We have to change it to 0 here. - P.labels[P.labels >= first_token_disambig_id] = 0 + labels = P.labels.clone() + labels[labels >= first_token_disambig_id] = 0 + P.labels = labels P = k2.remove_epsilon(P) P = k2.arc_sort(P)