Fix reporting of unused initializers in subgraphs (#19341)

### Description
<!-- Describe your changes. -->
Increment num_resolves_ inside the graph resolve finalization function
so the subgraphs have the same value.

This prevents incorrect output regarding removing unused initializers.

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
#19141
This commit is contained in:
Scott McKay 2024-02-01 08:02:12 +10:00 committed by GitHub
parent 55b60d8fe0
commit 68b6064be6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2798,12 +2798,13 @@ Status Graph::Resolve(const ResolveOptions& options) {
graph.GraphProtoSyncNeeded(false);
}
// set num_resolves_ here so the graph and any subgraphs all have the same value
++graph.num_resolves_;
return Status::OK(); };
ORT_RETURN_IF_ERROR(ForThisAndAllSubgraphs(all_subgraphs, finalize_func));
++num_resolves_;
return Status::OK();
}