fix mmi graph compiler bug. (#895)

This commit is contained in:
emilyluj 2023-02-09 18:32:03 +08:00 committed by GitHub
parent 5cd1636cb3
commit 59ac8bfc70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)