Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
49d2a778
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
49d2a778
编写于
8月 11, 2022
作者:
W
Weilong Wu
提交者:
GitHub
8月 11, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish black_ops_list logic in eager_gen (#44188)
* Polish black_ops_list logic in eager_gen * update black_ops_list
上级
b61d8f77
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
6 addition
and
4 deletion
+6
-4
paddle/fluid/eager/auto_code_generator/final_state_generator/eager_gen.py
...er/auto_code_generator/final_state_generator/eager_gen.py
+6
-4
未找到文件。
paddle/fluid/eager/auto_code_generator/final_state_generator/eager_gen.py
浏览文件 @
49d2a778
...
@@ -40,8 +40,11 @@ from codegen_utils import AssertMessage, GetIndent
...
@@ -40,8 +40,11 @@ from codegen_utils import AssertMessage, GetIndent
# keeping the code compatible, here we also skip inplace check in new dygraph temporarily,
# keeping the code compatible, here we also skip inplace check in new dygraph temporarily,
# and this will be fixed in the futrue.
# and this will be fixed in the futrue.
inplace_check_blacklist
=
set
([
"assign_out_"
])
inplace_check_blacklist
=
set
([
"assign_out_"
])
# # --- Black Ops list that's NO NEED to apply backward code generation
black_ops_list
=
[
"conv2d"
,
"conv2d_grad"
,
"conv2d_grad_grad"
,
"add_n"
]
# Black Ops list that's NO NEED to apply code generation
black_ops_list
=
[
"conv2d"
,
"conv2d_grad"
,
"conv2d_grad_grad"
,
"add_n"
,
"add_n_grad"
]
###########
###########
...
@@ -1637,7 +1640,6 @@ class DygraphForwardAndNodesGenerator(GeneratorBase):
...
@@ -1637,7 +1640,6 @@ class DygraphForwardAndNodesGenerator(GeneratorBase):
if
'backward'
not
in
forward_api_contents
.
keys
():
return
None
if
'backward'
not
in
forward_api_contents
.
keys
():
return
None
backward_api_name
=
forward_api_contents
[
'backward'
]
backward_api_name
=
forward_api_contents
[
'backward'
]
if
backward_api_name
in
black_ops_list
:
return
None
assert
backward_api_name
in
grad_api_dict
.
keys
(),
AssertMessage
(
assert
backward_api_name
in
grad_api_dict
.
keys
(),
AssertMessage
(
backward_api_name
,
grad_api_dict
.
keys
())
backward_api_name
,
grad_api_dict
.
keys
())
backward_api_contents
=
grad_api_dict
[
backward_api_name
]
backward_api_contents
=
grad_api_dict
[
backward_api_name
]
...
@@ -1655,7 +1657,7 @@ class DygraphForwardAndNodesGenerator(GeneratorBase):
...
@@ -1655,7 +1657,7 @@ class DygraphForwardAndNodesGenerator(GeneratorBase):
backward_api_contents
=
self
.
GetBackwardAPIContents
(
backward_api_contents
=
self
.
GetBackwardAPIContents
(
forward_api_contents
)
forward_api_contents
)
if
backward_api_contents
is
None
:
continue
if
backward_api_contents
is
None
:
continue
if
forward_api_contents
[
'api'
]
in
black_ops_list
:
continue
# Generate Dygraph Forward Function
# Generate Dygraph Forward Function
function_generator
=
DygraphForwardFunctionGenerator
(
function_generator
=
DygraphForwardFunctionGenerator
(
forward_api_contents
,
backward_api_contents
,
namespace
)
forward_api_contents
,
backward_api_contents
,
namespace
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录