Skip to content

Commit 4657b95

Browse files
tianleiwuguschmue
authored andcommitted
Fix type cast build error (#23423)
### Description - Fix a type cast in #23363. - Include some headers which are suggested by code scanning in that PR. ### Motivation and Context PostMerge has build error: ``` onnxruntime\core\framework\print_tensor_statistics_utils.h(92,55): error C2220: the following warning is treated as an error [D:\a\_work\1\b\Debug\onnxruntime_framework.vcxproj] ```
1 parent a5ffc5e commit 4657b95

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

onnxruntime/core/framework/debug_node_inputs_outputs_utils.cc

+3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
#include "core/framework/print_tensor_statistics_utils.h"
99
#include <iomanip>
1010
#include <cctype>
11+
#include <vector>
1112
#include <string>
13+
#include <algorithm>
14+
#include <utility>
1215

1316
#ifdef DEBUG_NODE_INPUTS_OUTPUTS_ENABLE_DUMP_TO_SQLDB
1417
#include <sqlite3.h>

onnxruntime/core/framework/debug_node_inputs_outputs_utils.h

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "core/framework/session_state.h"
2121
#include "core/graph/graph.h"
2222
#include <unordered_set>
23+
#include <unordered_map>
2324
#include <mutex>
2425
#include <string>
2526

onnxruntime/core/framework/print_tensor_statistics_utils.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ void PrintCommonStats(const T* data, size_t count, TensorStatisticsData& tensor_
8989
// Statistics for float and double only for now.
9090
if constexpr (std::is_same<T, float>::value) {
9191
tensor_statistics.is_float = true;
92-
tensor_statistics.float_min = static_cast<double>(min);
93-
tensor_statistics.float_max = static_cast<double>(max);
92+
tensor_statistics.float_min = static_cast<float>(min);
93+
tensor_statistics.float_max = static_cast<float>(max);
9494
}
9595
}
9696

0 commit comments

Comments
 (0)