Skip to content

Commit

Permalink
Move continue check higher
Browse files Browse the repository at this point in the history
  • Loading branch information
ivberg committed Oct 29, 2024
1 parent 9513dab commit 4a022a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions onnxruntime/core/session/inference_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3284,6 +3284,10 @@ void InferenceSession::LogAllSessions() {
for (const auto& session_pair : active_sessions_) {
InferenceSession* session = session_pair.second;

if (!session) {
continue;
}

Check warning on line 3290 in onnxruntime/core/session/inference_session.cc

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Missing username in TODO; it should look like "// TODO(my_username): Stuff." [readability/todo] [2] Raw Output: onnxruntime/core/session/inference_session.cc:3290: Missing username in TODO; it should look like "// TODO(my_username): Stuff." [readability/todo] [2]
auto model = session->model_;
if (nullptr != model) {
onnxruntime::Graph& graph = model->MainGraph();
Expand All @@ -3294,10 +3298,6 @@ void InferenceSession::LogAllSessions() {
session->telemetry_.event_name_, session->execution_providers_.GetIds(), model_has_fp16_inputs, true);
}

if (!session) {
continue;
}

InferenceSession::TraceSessionOptions(session->session_options_, true, *session->session_logger_);
}
}
Expand Down

0 comments on commit 4a022a3

Please sign in to comment.