diff --git a/python/paddle/fluid/dygraph/dygraph_to_static/variable_trans_func.py b/python/paddle/fluid/dygraph/dygraph_to_static/variable_trans_func.py index 673d30cffbe1e3cc8e6223cf4036b1f90702d607..eb791394069084728d240e17823dbde2d2b88299 100644 --- a/python/paddle/fluid/dygraph/dygraph_to_static/variable_trans_func.py +++ b/python/paddle/fluid/dygraph/dygraph_to_static/variable_trans_func.py @@ -18,6 +18,7 @@ import six import gast from paddle.fluid import core +from paddle.fluid import unique_name from paddle.fluid.framework import Variable from paddle.fluid.layers import fill_constant from paddle.fluid.layer_helper import LayerHelper @@ -84,7 +85,7 @@ def to_static_variable_gast_node(name): def create_static_variable_gast_node(name): func_code = "{} = paddle.jit.dy2static\ .data_layer_not_check(name='{}', shape=[-1], dtype='float32')".format( - name, name) + name, unique_name.generate(name)) return gast.parse(func_code).body[0]