Skip to content

Commit 0d6c753

Browse files
authored
[Cherry-pick][Dy2Stat] Fix unique_name in create_static_variable_gast_node (#33963) (#33980)
Bug fixes, [Cherry-pick][Dy2Stat] Fix unique_name in create_static_variable_gast_node (#33963)
1 parent fe82754 commit 0d6c753

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/paddle/fluid/dygraph/dygraph_to_static/variable_trans_func.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import gast
1919

2020
from paddle.fluid import core
21+
from paddle.fluid import unique_name
2122
from paddle.fluid.framework import Variable
2223
from paddle.fluid.layers import fill_constant
2324
from paddle.fluid.layer_helper import LayerHelper
@@ -84,7 +85,7 @@ def to_static_variable_gast_node(name):
8485
def create_static_variable_gast_node(name):
8586
func_code = "{} = paddle.jit.dy2static\
8687
.data_layer_not_check(name='{}', shape=[-1], dtype='float32')".format(
87-
name, name)
88+
name, unique_name.generate(name))
8889
return gast.parse(func_code).body[0]
8990

9091

0 commit comments

Comments
 (0)