MCPcopy Create free account
hub / github.com/alibaba/MNN / writeMaxValueRealtime

Function writeMaxValueRealtime

tools/cpp/getLinearInput.hpp:104–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104static void writeMaxValueRealtime(const std::string& opName, float maxValueFloat) {
105 std::lock_guard<std::mutex> lock(maxValueFileMutex);
106
107 if (!maxValueFile.is_open()) {
108 initMaxValueFile(currentMaxValueFile);
109 }
110
111 if (maxValueFile.is_open()) {
112 if (!isFirstMaxValue) {
113 maxValueFile << ",\n";
114 }
115
116 maxValueFile << " \"" << opName << "\": " << maxValueFloat;
117 maxValueFile.flush();
118 isFirstMaxValue = false;
119
120 MNN_PRINT("Saved max value: %s = %f\n", opName.c_str(), maxValueFloat);
121 }
122}
123
124static void cleanupAtExit() {
125 closeThresholdFile();

Callers 1

initGetMaxValueFunction · 0.85

Calls 4

initMaxValueFileFunction · 0.85
is_openMethod · 0.45
flushMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected