Skip to content

Commit

Permalink
Fix a bug in SaveInputOutputNamesToNodeMapping function (#18456)
Browse files Browse the repository at this point in the history
### Description
Fix a bug in SaveInputOutputNamesToNodeMapping function. The fix was
provided by Scott.

### Motivation and Context
  • Loading branch information
snnn committed Nov 15, 2023
1 parent 0a4d76d commit cc840c5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions onnxruntime/core/framework/session_state_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,10 @@ common::Status SaveInputOutputNamesToNodeMapping(const onnxruntime::GraphViewer&
// utils::CopyOneInputAcrossDevices is happy.

auto& input_map = session_state.GetInputNodeInfoMap();
auto end_map = input_map.cend();

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

0 comments on commit cc840c5

Please sign in to comment.