Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
5cccc69f
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 2 年 前同步成功
通知
2325
Star
20933
Fork
5424
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
5cccc69f
编写于
4月 22, 2020
作者:
L
Leo Chen
提交者:
GitHub
4月 22, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update name generator, test=develop (#24048)
* update name generator, test=develop * use c++ unique name generator, test=develop
上级
da803415
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
9 addition
and
5 deletion
+9
-5
paddle/fluid/pybind/imperative.cc
paddle/fluid/pybind/imperative.cc
+2
-0
paddle/fluid/pybind/op_function_generator.cc
paddle/fluid/pybind/op_function_generator.cc
+1
-2
python/paddle/fluid/unique_name.py
python/paddle/fluid/unique_name.py
+6
-3
未找到文件。
paddle/fluid/pybind/imperative.cc
浏览文件 @
5cccc69f
...
@@ -741,6 +741,8 @@ void BindImperative(py::module *m_ptr) {
...
@@ -741,6 +741,8 @@ void BindImperative(py::module *m_ptr) {
.
def
(
"_get_program_desc_tracer"
,
.
def
(
"_get_program_desc_tracer"
,
&
imperative
::
Tracer
::
GetProgramDescTracer
,
&
imperative
::
Tracer
::
GetProgramDescTracer
,
py
::
return_value_policy
::
reference
)
py
::
return_value_policy
::
reference
)
.
def
(
"_generate_unique_name"
,
&
imperative
::
Tracer
::
GenerateUniqueName
,
py
::
arg
(
"key"
)
=
"tmp"
)
.
def
(
"trace"
,
.
def
(
"trace"
,
[](
imperative
::
Tracer
&
self
,
const
std
::
string
&
type
,
[](
imperative
::
Tracer
&
self
,
const
std
::
string
&
type
,
const
PyNameVarBaseMap
&
ins
,
const
PyNameVarBaseMap
&
outs
,
const
PyNameVarBaseMap
&
ins
,
const
PyNameVarBaseMap
&
outs
,
...
...
paddle/fluid/pybind/op_function_generator.cc
浏览文件 @
5cccc69f
...
@@ -232,8 +232,7 @@ GenerateOpFunctions(const std::string& module_name) {
...
@@ -232,8 +232,7 @@ GenerateOpFunctions(const std::string& module_name) {
}
}
std
::
string
function_args
=
""
;
std
::
string
function_args
=
""
;
if
(
input_args
==
""
)
{
if
(
input_args
==
""
)
{
function_args
=
function_args
=
FUNCTION_ARGS_NO_INPUT
;
paddle
::
string
::
Sprintf
(
FUNCTION_ARGS_NO_INPUT
,
input_args
);
}
else
{
}
else
{
function_args
=
paddle
::
string
::
Sprintf
(
FUNCTION_ARGS
,
input_args
);
function_args
=
paddle
::
string
::
Sprintf
(
FUNCTION_ARGS
,
input_args
);
}
}
...
...
python/paddle/fluid/unique_name.py
浏览文件 @
5cccc69f
...
@@ -120,10 +120,13 @@ def generate(key):
...
@@ -120,10 +120,13 @@ def generate(key):
# mode. Therefore, we keep the variable name of Parameter currently.
# mode. Therefore, we keep the variable name of Parameter currently.
#
#
# Please fix me if a better method is found.
# Please fix me if a better method is found.
#
# NOTE(zhiqiu): use c++ unique_name_generator in dygraph mode,
# in order to keep name consistency.
def
generate_with_ignorable_key
(
key
):
def
generate_with_ignorable_key
(
key
):
from
.framework
import
in_dygraph_mode
from
.framework
import
in_dygraph_mode
,
_dygraph_tracer
if
in_dygraph_mode
():
if
in_dygraph_mode
():
key
=
"tmp"
return
_dygraph_tracer
().
_generate_unique_name
()
return
generator
(
key
)
return
generator
(
key
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录