Use node name to uniquify the subgraph nodes. (#15855)

### Description
<!-- Describe your changes. -->
Use the unique name of the function node name to uniquify the subgraph
node names.


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
Prevent duplicate node names in the graph.
- If it fixes an open issue, please link to the issue here. -->

https://github.com/microsoft/onnxruntime/issues/15849

---------

Co-authored-by: Satya Jandhyala <sajandhy@microsoft.com>
This commit is contained in:
satyajandhyala 2023-05-22 16:15:14 -07:00 committed by GitHub
parent 4dc4470cc7
commit 22a578c06c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4017,9 +4017,8 @@ Status Graph::InlineFunction(Node& callnode) {
// create a uniq_identifier to append to every node name and intermediate input\outputs
// to make sure there are no unintended duplicates
std::stringstream ss;
ss << "_" << static_cast<const void*>(&callnode) << "_";
auto uniq_identifier = ss.str();
ss << "_inline_" << callnode.OpType();
auto uniq_identifier = GenerateNodeName(ss.str());
// Replace a (function-call) node by an inlined graph.
if (!callnode.GetFunctionBody()) {
// This is the normal use-case: inlining a FunctionProto (representing