Conversation
|
I fixed an issue in the After reading lots of code, I am still confusing about the empty ragged.I think we have two kinds of empty ragged, their Anyway, there are certainly some other bugs relating to the empty ragged in our code, I will find time to find them out. |
|
Yes, in a 2-d ragged tensor, [ ] and [ [] ] are not the same but they both have zero elements. Note: the text form does not tell you the number of axes, for example [ ] is a representation of a valid ragged tensor with any number of axes. |
|
It looks fine to me. If you find any case where you are really not sure what should happen, because in your opinion the comments on the interface do not properly define the behavior for some input, then let me know and we can discuss it. |
We met serveral crashes when decoding with single wav, as post in k2-fsa/snowfall#239. I thought these crashes are all about empty inputs.
@luomingshuang 's issue locating in the
k2.index_selectfunction, occurs when the inputindexesis an empty tensor, see the comments in source code for details.@alucassch 's issue occuring in thenbest_decoding, is a bug in thek2.ragged.arg_max_persublist,. The function return[-1]with the empty input, which causes a strange behavior in the following code.Update: I made a mistake, the return value of
arg_max_persublistis expected, this was also a bug ink2.index(src, index). Ifsrcis an empty tensor,k2.indexshould return an empty tensor, in current implementation,k2.index([], [-1])would return[0].