Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
88f111f8
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看板
未验证
提交
88f111f8
编写于
8月 09, 2019
作者:
Z
Zeng Jinle
提交者:
GitHub
8月 09, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unused inplace act codes, test=develop (#19079)
上级
cfa63053
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
0 addition
and
32 deletion
+0
-32
paddle/fluid/operators/activation_op.cc
paddle/fluid/operators/activation_op.cc
+0
-14
paddle/fluid/operators/activation_op.h
paddle/fluid/operators/activation_op.h
+0
-15
paddle/fluid/pybind/pybind.cc
paddle/fluid/pybind/pybind.cc
+0
-3
未找到文件。
paddle/fluid/operators/activation_op.cc
浏览文件 @
88f111f8
...
@@ -36,20 +36,6 @@ static constexpr bool CanInplaceAct() {
...
@@ -36,20 +36,6 @@ static constexpr bool CanInplaceAct() {
return
GradFunctor
::
FwdDeps
()
==
kDepOut
||
GradFunctor
::
FwdDeps
()
==
kNoDeps
;
return
GradFunctor
::
FwdDeps
()
==
kDepOut
||
GradFunctor
::
FwdDeps
()
==
kNoDeps
;
}
}
std
::
unique_ptr
<
std
::
unordered_set
<
std
::
string
>>
GetInplaceOpSet
()
{
std
::
unique_ptr
<
std
::
unordered_set
<
std
::
string
>>
ret
(
new
std
::
unordered_set
<
std
::
string
>
());
#define INSERT_INTO_INPLACE_OP_SET(op_type, __omitted, fwd_functor, \
bwd_functor) \
if (CanInplaceAct<bwd_functor<float>>()) { \
ret->insert(#op_type); \
}
FOR_EACH_ACTIVATION_OP
(
INSERT_INTO_INPLACE_OP_SET
);
#undef INSERT_INTO_INPLACE_OP_SET
return
ret
;
}
#define REGISTER_ACTIVATION_OP_MAKER(OP_NAME, OP_COMMENT) \
#define REGISTER_ACTIVATION_OP_MAKER(OP_NAME, OP_COMMENT) \
class OP_NAME##OpMaker \
class OP_NAME##OpMaker \
: public ::paddle::framework::OpProtoAndCheckerMaker { \
: public ::paddle::framework::OpProtoAndCheckerMaker { \
...
...
paddle/fluid/operators/activation_op.h
浏览文件 @
88f111f8
...
@@ -49,21 +49,6 @@ enum ActBwdOpFwdDeps {
...
@@ -49,21 +49,6 @@ enum ActBwdOpFwdDeps {
kDepXOut
=
0x03
kDepXOut
=
0x03
};
};
std
::
unique_ptr
<
std
::
unordered_set
<
std
::
string
>>
GetInplaceOpSet
();
static
bool
IsInplace
(
const
std
::
string
&
op
)
{
static
auto
InplaceOpSet
=
GetInplaceOpSet
();
bool
inplace
=
InplaceOpSet
->
count
(
op
);
// for op_grad
const
int
kGradSuffixLen
=
4
;
if
(
op
.
size
()
>
kGradSuffixLen
&&
op
.
compare
(
op
.
size
()
-
kGradSuffixLen
-
1
,
kGradSuffixLen
,
"grad"
))
{
inplace
=
InplaceOpSet
->
count
(
op
.
substr
(
0
,
op
.
size
()
-
(
kGradSuffixLen
+
1
)));
}
return
inplace
;
}
/* The following operator can be used to process SelectedRows, because the
/* The following operator can be used to process SelectedRows, because the
* output of those operator for zero is zero too.
* output of those operator for zero is zero too.
*/
*/
...
...
paddle/fluid/pybind/pybind.cc
浏览文件 @
88f111f8
...
@@ -1080,9 +1080,6 @@ All parameter, weight, gradient are variables in Paddle.
...
@@ -1080,9 +1080,6 @@ All parameter, weight, gradient are variables in Paddle.
},
},
py
::
return_value_policy
::
take_ownership
);
py
::
return_value_policy
::
take_ownership
);
m
.
def
(
"IsInplace"
,
[](
std
::
string
op
)
->
bool
{
return
operators
::
IsInplace
(
op
);
});
m
.
def
(
"op_support_gpu"
,
OpSupportGPU
);
m
.
def
(
"op_support_gpu"
,
OpSupportGPU
);
#ifdef PADDLE_WITH_CUDA
#ifdef PADDLE_WITH_CUDA
m
.
def
(
"get_cuda_device_count"
,
platform
::
GetCUDADeviceCount
);
m
.
def
(
"get_cuda_device_count"
,
platform
::
GetCUDADeviceCount
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录