[Dy2St] fix name conflict between mulitple to_static
program
#52692
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
Bug fixes
PR changes
Others
Describe
修复子图 Fallback 时遇到的多个
to_static
生成的 Program 之间存在 name 冲突的问题,因此清除 Eager Tensor 的 name 以避免此问题问题的原因为两个
to_static
之间使用了enable_static
+disable_static
切换到了一个新的unique_name.guard
(infermeta 里会这样做),导致新的命名重新开始,因此会冲突另外由于动转静单测已经迁移到了好像有点问题,暂时不移动了test/dygraph_to_static
下,因此将 #52110 没有迁移的新单测一并移过去PCard-66972