Skip to content

Clarify some comments in rm_epsilon; fix possible bug there.#965

Open
danpovey wants to merge 2 commits intok2-fsa:masterfrom
danpovey:maybe_rmepsilon_bug_fix
Open

Clarify some comments in rm_epsilon; fix possible bug there.#965
danpovey wants to merge 2 commits intok2-fsa:masterfrom
danpovey:maybe_rmepsilon_bug_fix

Conversation

@danpovey
Copy link
Copy Markdown
Collaborator

No description provided.

@danpovey
Copy link
Copy Markdown
Collaborator Author

RE that change in rm_epsilon.cu: that loop would have looped indefinitely if those 2 arrays were different after the 1st iter.
So it looks to me like maybe the epsilon removal algorithm was never tested for inputs with 2 successive epsilons??? My bad, I suppose, but it would be nice if someone e.g. @pkufool could fix this.

@pkufool
Copy link
Copy Markdown
Collaborator

pkufool commented Apr 25, 2022

but it would be nice if someone e.g. @pkufool could fix this.

Sure.

Comment thread k2/csrc/rm_epsilon.cu Outdated
// change in the FsaVec (this can be by simple comparison on arcs vector,
// since thanks to sorting the order is deterministic).
Array1<Arc> epsilon_fsa_arcs = epsilon_fsa.values;
Array1<Arc> &epsilon_fsa_arcs = epsilon_fsa.values;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, sorry, I realized this is not the source of the problem, I did not notice the statement below, closure_fsa_arcs = cur_iter_closure_fsa.values;
I will refactor a little for clarity though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants