Ignore strides CHECK in FromTorch when input tensor is empty#782
Ignore strides CHECK in FromTorch when input tensor is empty#782danpovey merged 4 commits intok2-fsa:masterfrom
Conversation
|
@glynpu |
|
I think this PR do solve the issue (k2-fsa/snowfall#227 (comment)), apart from the stride checking problem, there is also a bug in |
|
I want to add a test case to cover the empty FsaVec, but I didn't find a way to construct a empty FsaVec. I thought there are some kinds of FsaVec, the first, FsaVec without any fsa (this kind cause this crash), the second, FsaVec contains empty fsas without states, the third, FsaVec contains empty fsas with states(surely no arcs). |
An Array1 that's default-constructed, with no region, is considered invalid. That is, it should not appear as an input argument to functions, and should not be produced as output from a function that had valid inputs. It can be considered an error, or just lead to a crash, if passed into a function. |
|
@pkufool feel free to merge if you think this is ready. |
See k2-fsa/snowfall#227 (comment)