Skip to content

Commit 6771b15

Browse files
committed
Fix a bug in SaveInputOutputNamesToNodeMapping function (#18456)
### Description Fix a bug in SaveInputOutputNamesToNodeMapping function. The fix was provided by Scott. ### Motivation and Context
1 parent 7d4ae18 commit 6771b15

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

onnxruntime/core/framework/session_state_utils.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,10 @@ common::Status SaveInputOutputNamesToNodeMapping(const onnxruntime::GraphViewer&
455455
// utils::CopyOneInputAcrossDevices is happy.
456456

457457
auto& input_map = session_state.GetInputNodeInfoMap();
458-
auto end_map = input_map.cend();
459458

460459
for (const auto& graph_input : graph_inputs) {
461460
const auto& name = graph_input->Name();
462-
if (input_map.find(name) == end_map) {
461+
if (input_map.find(name) == input_map.cend()) {
463462
// dummy entry for an input that we didn't find a use of in the graph. log it in case that's a bug.
464463
// utils::CopyOneInputAcrossDevices will use the input OrtValue as is given we don't believe it's used anywhere.
465464
LOGS(session_state.Logger(), INFO) << (graph.IsSubgraph() ? "Subgraph" : "Graph") << " input with name "

0 commit comments

Comments
 (0)