未验证 提交 740f4e30 编写于 作者: A Aurelius84 提交者: GitHub

[Dy2Stat]Fix unique_name in create_static_variable_gast_node (#33963)

上级 aa9fdd0d
...@@ -18,6 +18,7 @@ import six ...@@ -18,6 +18,7 @@ import six
import gast import gast
from paddle.fluid import core from paddle.fluid import core
from paddle.fluid import unique_name
from paddle.fluid.framework import Variable from paddle.fluid.framework import Variable
from paddle.fluid.layers import fill_constant from paddle.fluid.layers import fill_constant
from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.layer_helper import LayerHelper
...@@ -84,7 +85,7 @@ def to_static_variable_gast_node(name): ...@@ -84,7 +85,7 @@ def to_static_variable_gast_node(name):
def create_static_variable_gast_node(name): def create_static_variable_gast_node(name):
func_code = "{} = paddle.jit.dy2static\ func_code = "{} = paddle.jit.dy2static\
.data_layer_not_check(name='{}', shape=[-1], dtype='float32')".format( .data_layer_not_check(name='{}', shape=[-1], dtype='float32')".format(
name, name) name, unique_name.generate(name))
return gast.parse(func_code).body[0] return gast.parse(func_code).body[0]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册