[ONNX] Assign ONNXScopeName during function substituion (#82039)
Previously only traced IR graph stores module typename and variable name
in `scope` in `node`. This change enables such `scope` info for IR graph
generated by torch script.
Torch script produced IR graphs emit nodes for module object and module
method call. This structured graph is flattened in `function_substition`
pass prior to other ONNX conversion passes.
This PR extends `function_substition` pass to record the module typename
and variable name info in `scope`, while inlining the graph.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82039
Approved by: https://github.com/justinchuby, https://github.com/abock