Handle implicit usage of an initializer from multiple levels above a subgraph#200
Conversation
…t NodeArg usage. Allows using an initializer from multiple levels up to not fail. We would need to accumulate a list of initializers from all levels up otherwise, and doing so doesn't add any value. Improve a comment to clarify when the parent graph NodeArg lookup kicks in.
|
This is a high-level comment please. I'm seeing that we're having only one global namespace in a model now as sub-graphs now can refer to an initializer several levels-up. is this expected? |
I'm not aware of anything in ONNX that provides implicit namespacing. Is there something? I guess it would be possible to use Graph.name as a prefix, and accumulate those prefixes as you descend into nested subgraphs to provide implicit namespacing if that was desirable. That seems orthogonal to this change which is about an initializer coming from multiple levels up, regardless of whether there was some additional namespace information added. The initializer is in scope either way. |
|
I don't fully understand Ke's question: from the ONNX specification perspective, |
Simplify logic around creating relationship between nodes for implicit NodeArg usage. Allows using an initializer from multiple levels up to not fail. We would need to accumulate a list of initializers from all levels up otherwise, and doing so doesn't add any value vs inverting the logic and simply creating relationships based on known outputs.
Improve a comment to clarify when the parent graph NodeArg lookup kicks in.