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 2877e10c64db5d6586f38d919f146b7fa898453d..c7844f160cee5ac59c75071b38696fcc33982946 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]