From 6406616c2d3fd5eae0201cd4680258f7c4e937dd Mon Sep 17 00:00:00 2001
From: lyblsgo <lyblsgo@163.com>
Date: 星期一, 24 四月 2023 13:04:08 +0800
Subject: [PATCH] rename filenames
---
funasr/runtime/onnxruntime/src/commonfunc.h | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/funasr/runtime/onnxruntime/src/commonfunc.h b/funasr/runtime/onnxruntime/src/commonfunc.h
index 3f3c53a..cae1bd7 100644
--- a/funasr/runtime/onnxruntime/src/commonfunc.h
+++ b/funasr/runtime/onnxruntime/src/commonfunc.h
@@ -1,4 +1,12 @@
#pragma once
+#include <algorithm>
+typedef struct
+{
+ std::string msg;
+ float snippet_time;
+}FUNASR_RECOG_RESULT;
+
+
#ifdef _WIN32
#include <codecvt>
@@ -17,8 +25,6 @@
}
#endif
-
-
inline void getInputName(Ort::Session* session, string& inputName,int nIndex=0) {
size_t numInputNodes = session->GetInputCount();
@@ -42,4 +48,9 @@
}
}
-}
\ No newline at end of file
+}
+
+template <class ForwardIterator>
+inline static size_t argmax(ForwardIterator first, ForwardIterator last) {
+ return std::distance(first, std::max_element(first, last));
+}
--
Gitblit v1.9.1