Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
c43f8afb
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看板
提交
c43f8afb
编写于
3月 19, 2022
作者:
P
phlrain
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix generator bug;
上级
b6a94760
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
1 addition
and
5 deletion
+1
-5
paddle/fluid/eager/auto_code_generator/final_state_generator/eager_gen.py
...er/auto_code_generator/final_state_generator/eager_gen.py
+1
-5
未找到文件。
paddle/fluid/eager/auto_code_generator/final_state_generator/eager_gen.py
浏览文件 @
c43f8afb
...
@@ -760,12 +760,10 @@ def GenerateNodeCreationCodes(
...
@@ -760,12 +760,10 @@ def GenerateNodeCreationCodes(
# SetTensorWrappers
# SetTensorWrappers
set_tensor_wrappers_list
=
[]
set_tensor_wrappers_list
=
[]
fwd_api_input_num
=
0
for
name
,
(
atype
,
is_fwd_input
,
pos
)
in
backward_fwd_input_map
.
items
():
for
name
,
(
atype
,
is_fwd_input
,
pos
)
in
backward_fwd_input_map
.
items
():
is_optional
=
(
name
in
optional_inputs
)
is_optional
=
(
name
in
optional_inputs
)
if
is_fwd_input
:
if
is_fwd_input
:
fwd_api_input_num
+=
1
if
is_optional
:
if
is_optional
:
set_tensor_wrappers
=
f
" if(
{
name
}
.is_initialized()) grad_node->SetTensorWrapper
{
name
}
(
{
name
}
, true);"
set_tensor_wrappers
=
f
" if(
{
name
}
.is_initialized()) grad_node->SetTensorWrapper
{
name
}
(
{
name
}
, true);"
else
:
else
:
...
@@ -777,9 +775,7 @@ def GenerateNodeCreationCodes(
...
@@ -777,9 +775,7 @@ def GenerateNodeCreationCodes(
fwd_output_pos
=
forward_outputs_position_map
[
name
][
1
]
fwd_output_pos
=
forward_outputs_position_map
[
name
][
1
]
tw_name
=
f
"std::get<
{
fwd_output_pos
}
>(api_result)"
tw_name
=
f
"std::get<
{
fwd_output_pos
}
>(api_result)"
else
:
else
:
assert
IsPlainTensorType
(
atype
),
atype
tw_name
=
f
"api_result"
out_pos
=
pos
-
fwd_api_input_num
tw_name
=
f
"std::get<
{
out_pos
}
>(api_result)"
if
is_optional
:
if
is_optional
:
set_tensor_wrappers
=
f
" if(
{
tw_name
}
.is_initialized()) grad_node->SetTensorWrapper
{
name
}
(
{
tw_name
}
, false);"
set_tensor_wrappers
=
f
" if(
{
tw_name
}
.is_initialized()) grad_node->SetTensorWrapper
{
name
}
(
{
tw_name
}
, false);"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录