From 23e7ddebccd3b05cf7ef89809bcfe565ad6dfa1f Mon Sep 17 00:00:00 2001
From: majic31 <majic31@163.com>
Date: 星期二, 24 十二月 2024 10:00:14 +0800
Subject: [PATCH] Fix the variable name (#2328)

---
 runtime/onnxruntime/src/util.cpp |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/runtime/onnxruntime/src/util.cpp b/runtime/onnxruntime/src/util.cpp
index a12570b..50c9c82 100644
--- a/runtime/onnxruntime/src/util.cpp
+++ b/runtime/onnxruntime/src/util.cpp
@@ -646,6 +646,21 @@
   return elems;
 }
 
+std::vector<std::string> SplitStr(const std::string &s, string delimiter) {
+    std::vector<std::string> tokens;
+    size_t start = 0;
+    size_t end = s.find(delimiter);
+
+    while (end != std::string::npos) {
+        tokens.push_back(s.substr(start, end - start));
+        start = end + delimiter.length();
+        end = s.find(delimiter, start);
+    }
+    tokens.push_back(s.substr(start, end - start));
+
+    return tokens;
+}
+
 template<typename T>
 void PrintMat(const std::vector<std::vector<T>> &mat, const std::string &name) {
   std::cout << name << ":" << std::endl;
@@ -870,6 +885,15 @@
                 sum -=(1.0 - 1e-4);
             }            
         }
+        // fix case: sum > 1
+        int cif_idx = cif_peak.size()-1;
+        while(sum>=1.0 - 1e-4 && cif_idx >= 0 ){
+            if(cif_peak[cif_idx] < 1.0 - 1e-4){
+                cif_peak[cif_idx] = sum;
+                sum -=(1.0 - 1e-4);
+            }
+            cif_idx--;
+        }
 
         fire_place.clear();
         for (int i = 0; i < num_frames; i++) {

--
Gitblit v1.9.1