share GetHypsRowSplits interface and fix getting Topk not taking logprob (#131)

This commit is contained in:
PF Luo
2023-04-26 11:41:04 +08:00
committed by GitHub
parent 86017f9833
commit aa7108729b
4 changed files with 52 additions and 38 deletions

View File

@@ -15,21 +15,6 @@
namespace sherpa_onnx {
static std::vector<int32_t> GetHypsRowSplits(
const std::vector<Hypotheses> &hyps) {
std::vector<int32_t> row_splits;
row_splits.reserve(hyps.size() + 1);
row_splits.push_back(0);
int32_t s = 0;
for (const auto &h : hyps) {
s += h.Size();
row_splits.push_back(s);
}
return row_splits;
}
std::vector<OfflineTransducerDecoderResult>
OfflineTransducerModifiedBeamSearchDecoder::Decode(
Ort::Value encoder_out, Ort::Value encoder_out_length) {