From 55708e7cebaedefc5f69d61f157993da41848b8f Mon Sep 17 00:00:00 2001
From: lyblsgo <lyblsgo@163.com>
Date: 星期日, 23 四月 2023 19:06:25 +0800
Subject: [PATCH] add offline punc for onnxruntime
---
funasr/runtime/onnxruntime/src/commonfunc.h | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/funasr/runtime/onnxruntime/src/commonfunc.h b/funasr/runtime/onnxruntime/src/commonfunc.h
index 8d1a97c..cae1bd7 100644
--- a/funasr/runtime/onnxruntime/src/commonfunc.h
+++ b/funasr/runtime/onnxruntime/src/commonfunc.h
@@ -1,5 +1,5 @@
#pragma once
-
+#include <algorithm>
typedef struct
{
std::string msg;
@@ -49,3 +49,8 @@
}
}
}
+
+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