Exporting to C++

Is using torch.jit.trace to export to C++ a goal for SpeechBrain?

To expand:

I just tried it, and ran into an issue with dataio.length_to_mask(). Specifically, it reports mask = torch.as_tensor(mask, dtype=dtype, device=device) as constant. I think this means it’ll use the mask from when the trace was run rather than computing it at run time in C++.

I don’t think this is the only problem, since using audio files at trace time and run time that are the same length but with different audio produces incorrect results in C++ compared to python.

I’m by no means an expert on this, but would be happy to pursue a bit more if exporting to C++ is a goal.

It is. Many companies are interested by that. We will invest hopefully soon, some time on that. We should be Jit compatible for most part however as some models use it. But this isn’t a “research” direction per-say, so we need external help to address it!

1 Like