Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
a6fbba65
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
a6fbba65
编写于
5月 27, 2020
作者:
L
Leo Chen
提交者:
GitHub
5月 27, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename inplace/no_need_buffer inferer, part3, test=develop (#24734)
上级
4aa90990
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
46 addition
and
50 deletion
+46
-50
paddle/fluid/operators/reduce_ops/reduce_mean_op.cc
paddle/fluid/operators/reduce_ops/reduce_mean_op.cc
+2
-3
paddle/fluid/operators/reduce_ops/reduce_sum_op.cc
paddle/fluid/operators/reduce_ops/reduce_sum_op.cc
+2
-2
paddle/fluid/operators/sequence_ops/sequence_concat_op.cc
paddle/fluid/operators/sequence_ops/sequence_concat_op.cc
+2
-3
paddle/fluid/operators/sequence_ops/sequence_expand_as_op.cc
paddle/fluid/operators/sequence_ops/sequence_expand_as_op.cc
+4
-4
paddle/fluid/operators/sequence_ops/sequence_expand_op.cc
paddle/fluid/operators/sequence_ops/sequence_expand_op.cc
+5
-5
paddle/fluid/operators/sequence_ops/sequence_pad_op.cc
paddle/fluid/operators/sequence_ops/sequence_pad_op.cc
+2
-2
paddle/fluid/operators/sequence_ops/sequence_pool_op.cc
paddle/fluid/operators/sequence_ops/sequence_pool_op.cc
+2
-2
paddle/fluid/operators/sequence_ops/sequence_scatter_op.cc
paddle/fluid/operators/sequence_ops/sequence_scatter_op.cc
+3
-3
paddle/fluid/operators/sequence_ops/sequence_slice_op.cc
paddle/fluid/operators/sequence_ops/sequence_slice_op.cc
+2
-2
paddle/fluid/operators/sequence_ops/sequence_unpad_op.cc
paddle/fluid/operators/sequence_ops/sequence_unpad_op.cc
+3
-3
paddle/fluid/operators/space_to_depth_op.cc
paddle/fluid/operators/space_to_depth_op.cc
+2
-2
paddle/fluid/operators/squared_l2_distance_op.cc
paddle/fluid/operators/squared_l2_distance_op.cc
+3
-2
paddle/fluid/operators/squeeze_op.cc
paddle/fluid/operators/squeeze_op.cc
+2
-2
paddle/fluid/operators/strided_slice_op.cc
paddle/fluid/operators/strided_slice_op.cc
+2
-2
paddle/fluid/operators/trace_op.cc
paddle/fluid/operators/trace_op.cc
+2
-3
paddle/fluid/operators/unfold_op.cc
paddle/fluid/operators/unfold_op.cc
+2
-2
paddle/fluid/operators/unsqueeze_op.cc
paddle/fluid/operators/unsqueeze_op.cc
+2
-3
paddle/fluid/operators/warpctc_op.cc
paddle/fluid/operators/warpctc_op.cc
+2
-2
paddle/fluid/operators/where_op.cc
paddle/fluid/operators/where_op.cc
+2
-3
未找到文件。
paddle/fluid/operators/reduce_ops/reduce_mean_op.cc
浏览文件 @
a6fbba65
...
@@ -82,8 +82,7 @@ class ReduceMeanDoubleGradOpBaseMaker : public imperative::GradOpBaseMakerBase {
...
@@ -82,8 +82,7 @@ class ReduceMeanDoubleGradOpBaseMaker : public imperative::GradOpBaseMakerBase {
}
}
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
ReduceMeanGradNoNeedBufferVarInference
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
ReduceMeanGradNoNeedBufferVarInferer
,
"X"
);
"X"
);
}
// namespace operators
}
// namespace operators
}
// namespace paddle
}
// namespace paddle
...
@@ -99,7 +98,7 @@ REGISTER_OPERATOR(reduce_mean, ops::ReduceOp, __reduce_meanMaker__,
...
@@ -99,7 +98,7 @@ REGISTER_OPERATOR(reduce_mean, ops::ReduceOp, __reduce_meanMaker__,
REGISTER_OPERATOR
(
reduce_mean_grad
,
ops
::
ReduceGradOp
,
REGISTER_OPERATOR
(
reduce_mean_grad
,
ops
::
ReduceGradOp
,
ops
::
ReduceMeanDoubleGradDescMaker
,
ops
::
ReduceMeanDoubleGradDescMaker
,
ops
::
ReduceMeanDoubleGradOpBaseMaker
,
ops
::
ReduceMeanDoubleGradOpBaseMaker
,
ops
::
ReduceMeanGradNoNeedBufferVarInfere
nce
);
ops
::
ReduceMeanGradNoNeedBufferVarInfere
r
);
REGISTER_OP_CPU_KERNEL
(
reduce_mean
,
REGISTER_OP_CPU_KERNEL
(
reduce_mean
,
ops
::
ReduceKernel
<
paddle
::
platform
::
CPUDeviceContext
,
ops
::
ReduceKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
,
ops
::
MeanFunctor
>
,
float
,
ops
::
MeanFunctor
>
,
...
...
paddle/fluid/operators/reduce_ops/reduce_sum_op.cc
浏览文件 @
a6fbba65
...
@@ -51,7 +51,7 @@ class ReduceSumOpGradMaker : public framework::SingleGradOpMaker<T> {
...
@@ -51,7 +51,7 @@ class ReduceSumOpGradMaker : public framework::SingleGradOpMaker<T> {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
ReduceSumGradNoNeedBufferVarInfere
nce
,
"X"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
ReduceSumGradNoNeedBufferVarInfere
r
,
"X"
);
class
ReduceSumVarTypeInference
:
public
paddle
::
framework
::
VarTypeInference
{
class
ReduceSumVarTypeInference
:
public
paddle
::
framework
::
VarTypeInference
{
public:
public:
void
operator
()(
paddle
::
framework
::
InferVarTypeContext
*
ctx
)
const
override
{
void
operator
()(
paddle
::
framework
::
InferVarTypeContext
*
ctx
)
const
override
{
...
@@ -77,7 +77,7 @@ REGISTER_OPERATOR(reduce_sum, ops::ReduceOp, ReduceSumOpMaker,
...
@@ -77,7 +77,7 @@ REGISTER_OPERATOR(reduce_sum, ops::ReduceOp, ReduceSumOpMaker,
ops
::
ReduceSumOpGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
ReduceSumOpGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
ReduceSumOpGradMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
ReduceSumOpGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
reduce_sum_grad
,
ops
::
ReduceGradOp
,
REGISTER_OPERATOR
(
reduce_sum_grad
,
ops
::
ReduceGradOp
,
ops
::
ReduceSumGradNoNeedBufferVarInfere
nce
);
ops
::
ReduceSumGradNoNeedBufferVarInfere
r
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
reduce_sum
,
ops
::
ReduceKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
,
reduce_sum
,
ops
::
ReduceKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
,
...
...
paddle/fluid/operators/sequence_ops/sequence_concat_op.cc
浏览文件 @
a6fbba65
...
@@ -123,8 +123,7 @@ class SeqConcatGradOp : public framework::OperatorWithKernel {
...
@@ -123,8 +123,7 @@ class SeqConcatGradOp : public framework::OperatorWithKernel {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SeqConcatGradNoNeedBufferVarsInference
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SeqConcatGradNoNeedBufferVarsInferer
,
"X"
);
"X"
);
}
// namespace operators
}
// namespace operators
}
// namespace paddle
}
// namespace paddle
...
@@ -140,7 +139,7 @@ REGISTER_OP_CPU_KERNEL(sequence_concat, Kernel<float>, Kernel<double>,
...
@@ -140,7 +139,7 @@ REGISTER_OP_CPU_KERNEL(sequence_concat, Kernel<float>, Kernel<double>,
Kernel
<
int
>
,
Kernel
<
int64_t
>
);
Kernel
<
int
>
,
Kernel
<
int64_t
>
);
REGISTER_OPERATOR
(
sequence_concat_grad
,
op
::
SeqConcatGradOp
,
REGISTER_OPERATOR
(
sequence_concat_grad
,
op
::
SeqConcatGradOp
,
op
::
SeqConcatGradNoNeedBufferVarsInfere
nce
);
op
::
SeqConcatGradNoNeedBufferVarsInfere
r
);
template
<
typename
T
>
template
<
typename
T
>
using
GradKernel
=
using
GradKernel
=
op
::
SeqConcatGradKernel
<
paddle
::
platform
::
CPUDeviceContext
,
T
>
;
op
::
SeqConcatGradKernel
<
paddle
::
platform
::
CPUDeviceContext
,
T
>
;
...
...
paddle/fluid/operators/sequence_ops/sequence_expand_as_op.cc
浏览文件 @
a6fbba65
...
@@ -181,10 +181,10 @@ class SequenceExpandAsOpGradOpMaker : public framework::SingleGradOpMaker<T> {
...
@@ -181,10 +181,10 @@ class SequenceExpandAsOpGradOpMaker : public framework::SingleGradOpMaker<T> {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequenceExpandAsOpNoNeedBufferVarsInfere
nce
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequenceExpandAsOpNoNeedBufferVarsInfere
r
,
"Y"
);
"Y"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequenceExpandAsGradOpNoNeedBufferVarsInfere
nce
,
"X"
,
"Y"
);
SequenceExpandAsGradOpNoNeedBufferVarsInfere
r
,
"X"
,
"Y"
);
}
// namespace operators
}
// namespace operators
}
// namespace paddle
}
// namespace paddle
...
@@ -194,9 +194,9 @@ REGISTER_OPERATOR(
...
@@ -194,9 +194,9 @@ REGISTER_OPERATOR(
sequence_expand_as
,
ops
::
SequenceExpandAsOp
,
ops
::
SequenceExpandAsOpMaker
,
sequence_expand_as
,
ops
::
SequenceExpandAsOp
,
ops
::
SequenceExpandAsOpMaker
,
ops
::
SequenceExpandAsOpGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequenceExpandAsOpGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequenceExpandAsOpGradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
SequenceExpandAsOpGradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
SequenceExpandAsOpNoNeedBufferVarsInfere
nce
);
ops
::
SequenceExpandAsOpNoNeedBufferVarsInfere
r
);
REGISTER_OPERATOR
(
sequence_expand_as_grad
,
ops
::
SequenceExpandAsOpGrad
,
REGISTER_OPERATOR
(
sequence_expand_as_grad
,
ops
::
SequenceExpandAsOpGrad
,
ops
::
SequenceExpandAsGradOpNoNeedBufferVarsInfere
nce
);
ops
::
SequenceExpandAsGradOpNoNeedBufferVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
sequence_expand_as
,
sequence_expand_as
,
ops
::
SequenceExpandAsKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
ops
::
SequenceExpandAsKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
...
...
paddle/fluid/operators/sequence_ops/sequence_expand_op.cc
浏览文件 @
a6fbba65
...
@@ -247,10 +247,10 @@ class SequenceExpandOpGradMaker : public framework::SingleGradOpMaker<T> {
...
@@ -247,10 +247,10 @@ class SequenceExpandOpGradMaker : public framework::SingleGradOpMaker<T> {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequenceExpandOpNoNeedBufferVarsInfere
nce
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequenceExpandOpNoNeedBufferVarsInfere
r
,
"Y"
);
"Y"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequenceExpandGradOpNoNeedBufferVarsInferer
,
SequenceExpandGradOpNoNeedBufferVarsInference
,
"X"
,
"Y"
);
"X"
,
"Y"
);
}
// namespace operators
}
// namespace operators
}
// namespace paddle
}
// namespace paddle
...
@@ -260,9 +260,9 @@ REGISTER_OPERATOR(sequence_expand, ops::SequenceExpandOp,
...
@@ -260,9 +260,9 @@ REGISTER_OPERATOR(sequence_expand, ops::SequenceExpandOp,
ops
::
SequenceExpandOpMaker
,
ops
::
SequenceExpandOpMaker
,
ops
::
SequenceExpandOpGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequenceExpandOpGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequenceExpandOpGradMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
SequenceExpandOpGradMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
SequenceExpandOpNoNeedBufferVarsInfere
nce
);
ops
::
SequenceExpandOpNoNeedBufferVarsInfere
r
);
REGISTER_OPERATOR
(
sequence_expand_grad
,
ops
::
SequenceExpandOpGrad
,
REGISTER_OPERATOR
(
sequence_expand_grad
,
ops
::
SequenceExpandOpGrad
,
ops
::
SequenceExpandGradOpNoNeedBufferVarsInfere
nce
);
ops
::
SequenceExpandGradOpNoNeedBufferVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
sequence_expand
,
sequence_expand
,
ops
::
SequenceExpandKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
ops
::
SequenceExpandKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
...
...
paddle/fluid/operators/sequence_ops/sequence_pad_op.cc
浏览文件 @
a6fbba65
...
@@ -251,7 +251,7 @@ class SequencePadGradOpMaker : public framework::SingleGradOpMaker<T> {
...
@@ -251,7 +251,7 @@ class SequencePadGradOpMaker : public framework::SingleGradOpMaker<T> {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequencePadGradOpNoNeedBufferVarsInfere
nce
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequencePadGradOpNoNeedBufferVarsInfere
r
,
"X"
);
"X"
);
}
// namespace operators
}
// namespace operators
...
@@ -262,7 +262,7 @@ REGISTER_OPERATOR(sequence_pad, ops::SequencePadOp, ops::SequencePadOpMaker,
...
@@ -262,7 +262,7 @@ REGISTER_OPERATOR(sequence_pad, ops::SequencePadOp, ops::SequencePadOpMaker,
ops
::
SequencePadGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequencePadGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequencePadGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
SequencePadGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
sequence_pad_grad
,
ops
::
SequencePadGradOp
,
REGISTER_OPERATOR
(
sequence_pad_grad
,
ops
::
SequencePadGradOp
,
ops
::
SequencePadGradOpNoNeedBufferVarsInfere
nce
);
ops
::
SequencePadGradOpNoNeedBufferVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
sequence_pad
,
sequence_pad
,
ops
::
SequencePadOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
ops
::
SequencePadOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
...
...
paddle/fluid/operators/sequence_ops/sequence_pool_op.cc
浏览文件 @
a6fbba65
...
@@ -166,7 +166,7 @@ class SequencePoolGradOpMaker : public framework::SingleGradOpMaker<T> {
...
@@ -166,7 +166,7 @@ class SequencePoolGradOpMaker : public framework::SingleGradOpMaker<T> {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequencePoolGradOpNoNeedBufferVarsInfere
nce
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequencePoolGradOpNoNeedBufferVarsInfere
r
,
"X"
);
"X"
);
}
// namespace operators
}
// namespace operators
...
@@ -177,7 +177,7 @@ REGISTER_OPERATOR(sequence_pool, ops::SequencePoolOp, ops::SequencePoolOpMaker,
...
@@ -177,7 +177,7 @@ REGISTER_OPERATOR(sequence_pool, ops::SequencePoolOp, ops::SequencePoolOpMaker,
ops
::
SequencePoolGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequencePoolGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequencePoolGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
SequencePoolGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
sequence_pool_grad
,
ops
::
SequencePoolGradOp
,
REGISTER_OPERATOR
(
sequence_pool_grad
,
ops
::
SequencePoolGradOp
,
ops
::
SequencePoolGradOpNoNeedBufferVarsInfere
nce
);
ops
::
SequencePoolGradOpNoNeedBufferVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
sequence_pool
,
sequence_pool
,
ops
::
SequencePoolKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
);
ops
::
SequencePoolKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
);
...
...
paddle/fluid/operators/sequence_ops/sequence_scatter_op.cc
浏览文件 @
a6fbba65
...
@@ -168,8 +168,8 @@ class SequenceScatterGradMaker : public framework::SingleGradOpMaker<T> {
...
@@ -168,8 +168,8 @@ class SequenceScatterGradMaker : public framework::SingleGradOpMaker<T> {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequenceScatterGradNoNeedBufferVarsInferer
,
SequenceScatterGradNoNeedBufferVarsInference
,
"Updates"
);
"Updates"
);
}
// namespace operators
}
// namespace operators
}
// namespace paddle
}
// namespace paddle
...
@@ -180,7 +180,7 @@ REGISTER_OPERATOR(sequence_scatter, ops::SequenceScatterOp,
...
@@ -180,7 +180,7 @@ REGISTER_OPERATOR(sequence_scatter, ops::SequenceScatterOp,
ops
::
SequenceScatterGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequenceScatterGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequenceScatterGradMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
SequenceScatterGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
sequence_scatter_grad
,
ops
::
SequenceScatterGradOp
,
REGISTER_OPERATOR
(
sequence_scatter_grad
,
ops
::
SequenceScatterGradOp
,
ops
::
SequenceScatterGradNoNeedBufferVarsInfere
nce
);
ops
::
SequenceScatterGradNoNeedBufferVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
sequence_scatter
,
ops
::
SequenceScatterOpKernel
<
float
>
,
REGISTER_OP_CPU_KERNEL
(
sequence_scatter
,
ops
::
SequenceScatterOpKernel
<
float
>
,
ops
::
SequenceScatterOpKernel
<
double
>
,
ops
::
SequenceScatterOpKernel
<
double
>
,
ops
::
SequenceScatterOpKernel
<
int
>
,
ops
::
SequenceScatterOpKernel
<
int
>
,
...
...
paddle/fluid/operators/sequence_ops/sequence_slice_op.cc
浏览文件 @
a6fbba65
...
@@ -137,7 +137,7 @@ class SequenceSliceGradOpMaker : public framework::SingleGradOpMaker<T> {
...
@@ -137,7 +137,7 @@ class SequenceSliceGradOpMaker : public framework::SingleGradOpMaker<T> {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequenceSliceGradNoNeedBufferVarsInfere
nce
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequenceSliceGradNoNeedBufferVarsInfere
r
,
"X"
);
"X"
);
}
// namespace operators
}
// namespace operators
...
@@ -149,7 +149,7 @@ REGISTER_OPERATOR(sequence_slice, ops::SequenceSliceOp,
...
@@ -149,7 +149,7 @@ REGISTER_OPERATOR(sequence_slice, ops::SequenceSliceOp,
ops
::
SequenceSliceGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequenceSliceGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequenceSliceGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
SequenceSliceGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
sequence_slice_grad
,
ops
::
SequenceSliceGradOp
,
REGISTER_OPERATOR
(
sequence_slice_grad
,
ops
::
SequenceSliceGradOp
,
ops
::
SequenceSliceGradNoNeedBufferVarsInfere
nce
);
ops
::
SequenceSliceGradNoNeedBufferVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
sequence_slice
,
sequence_slice
,
ops
::
SequenceSliceOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
ops
::
SequenceSliceOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
...
...
paddle/fluid/operators/sequence_ops/sequence_unpad_op.cc
浏览文件 @
a6fbba65
...
@@ -169,8 +169,8 @@ class SequenceUnpadGradOpMaker : public framework::SingleGradOpMaker<T> {
...
@@ -169,8 +169,8 @@ class SequenceUnpadGradOpMaker : public framework::SingleGradOpMaker<T> {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SequenceUnpadGradOpNoNeedBufferVarsInferer
,
SequenceUnpadGradOpNoNeedBufferVarsInference
,
"X"
);
"X"
);
}
// namespace operators
}
// namespace operators
}
// namespace paddle
}
// namespace paddle
...
@@ -181,7 +181,7 @@ REGISTER_OPERATOR(sequence_unpad, ops::SequenceUnpadOp,
...
@@ -181,7 +181,7 @@ REGISTER_OPERATOR(sequence_unpad, ops::SequenceUnpadOp,
ops
::
SequenceUnpadGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequenceUnpadGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SequenceUnpadGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
SequenceUnpadGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
sequence_unpad_grad
,
ops
::
SequenceUnpadGradOp
,
REGISTER_OPERATOR
(
sequence_unpad_grad
,
ops
::
SequenceUnpadGradOp
,
ops
::
SequenceUnpadGradOpNoNeedBufferVarsInfere
nce
);
ops
::
SequenceUnpadGradOpNoNeedBufferVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
sequence_unpad
,
sequence_unpad
,
ops
::
SequenceUnpadOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
ops
::
SequenceUnpadOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
...
...
paddle/fluid/operators/space_to_depth_op.cc
浏览文件 @
a6fbba65
...
@@ -131,7 +131,7 @@ class SpaceToDepthOpMaker : public framework::OpProtoAndCheckerMaker {
...
@@ -131,7 +131,7 @@ class SpaceToDepthOpMaker : public framework::OpProtoAndCheckerMaker {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SpaceToDepthGradOpNoBuffer
,
"X"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SpaceToDepthGradOpNoBuffer
Inferer
,
"X"
);
template
<
typename
T
>
template
<
typename
T
>
class
SpaceToDepthGradOpMaker
:
public
framework
::
SingleGradOpMaker
<
T
>
{
class
SpaceToDepthGradOpMaker
:
public
framework
::
SingleGradOpMaker
<
T
>
{
...
@@ -179,7 +179,7 @@ REGISTER_OPERATOR(space_to_depth, ops::SpaceToDepthOp, ops::SpaceToDepthOpMaker,
...
@@ -179,7 +179,7 @@ REGISTER_OPERATOR(space_to_depth, ops::SpaceToDepthOp, ops::SpaceToDepthOpMaker,
ops
::
SpaceToDepthGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SpaceToDepthGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SpaceToDepthGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
SpaceToDepthGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
space_to_depth_grad
,
ops
::
SpaceToDepthGradOp
,
REGISTER_OPERATOR
(
space_to_depth_grad
,
ops
::
SpaceToDepthGradOp
,
ops
::
SpaceToDepthGradOpNoBuffer
);
ops
::
SpaceToDepthGradOpNoBuffer
Inferer
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
space_to_depth
,
space_to_depth
,
ops
::
SpaceToDepthKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
ops
::
SpaceToDepthKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
...
...
paddle/fluid/operators/squared_l2_distance_op.cc
浏览文件 @
a6fbba65
...
@@ -88,7 +88,8 @@ class SquaredL2DistanceOp : public framework::OperatorWithKernel {
...
@@ -88,7 +88,8 @@ class SquaredL2DistanceOp : public framework::OperatorWithKernel {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SquaredL2DistanceGradOpNoBuffer
,
"X"
,
"Y"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SquaredL2DistanceGradOpNoBufferInferer
,
"X"
,
"Y"
);
template
<
typename
T
>
template
<
typename
T
>
class
SquaredL2DistanceGradOpMaker
:
public
framework
::
SingleGradOpMaker
<
T
>
{
class
SquaredL2DistanceGradOpMaker
:
public
framework
::
SingleGradOpMaker
<
T
>
{
...
@@ -192,7 +193,7 @@ REGISTER_OPERATOR(
...
@@ -192,7 +193,7 @@ REGISTER_OPERATOR(
ops
::
SquaredL2DistanceGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SquaredL2DistanceGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SquaredL2DistanceGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
SquaredL2DistanceGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
squared_l2_distance_grad
,
ops
::
SquaredL2DistanceGradOp
,
REGISTER_OPERATOR
(
squared_l2_distance_grad
,
ops
::
SquaredL2DistanceGradOp
,
ops
::
SquaredL2DistanceGradOpNoBuffer
);
ops
::
SquaredL2DistanceGradOpNoBuffer
Inferer
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
squared_l2_distance
,
squared_l2_distance
,
ops
::
SquaredL2DistanceKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
);
ops
::
SquaredL2DistanceKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
);
...
...
paddle/fluid/operators/squeeze_op.cc
浏览文件 @
a6fbba65
...
@@ -275,7 +275,7 @@ DECLARE_INPLACE_OP_INFERER(SequeezeInplaceInferer, {"X", "Out"});
...
@@ -275,7 +275,7 @@ DECLARE_INPLACE_OP_INFERER(SequeezeInplaceInferer, {"X", "Out"});
DECLARE_INPLACE_OP_INFERER
(
SequeezeGradInplaceInferer
,
DECLARE_INPLACE_OP_INFERER
(
SequeezeGradInplaceInferer
,
{
framework
::
GradVarName
(
"Out"
),
{
framework
::
GradVarName
(
"Out"
),
framework
::
GradVarName
(
"X"
)});
framework
::
GradVarName
(
"X"
)});
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SqueezeGradNoNeedBufferVarsInfere
nce
,
"X"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
SqueezeGradNoNeedBufferVarsInfere
r
,
"X"
);
}
// namespace operators
}
// namespace operators
}
// namespace paddle
}
// namespace paddle
...
@@ -284,7 +284,7 @@ REGISTER_OPERATOR(squeeze, ops::SqueezeOp, ops::SqueezeOpMaker,
...
@@ -284,7 +284,7 @@ REGISTER_OPERATOR(squeeze, ops::SqueezeOp, ops::SqueezeOpMaker,
ops
::
SqueezeGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SqueezeGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SqueezeGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
SqueezeGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
squeeze_grad
,
ops
::
SqueezeGradOp
,
REGISTER_OPERATOR
(
squeeze_grad
,
ops
::
SqueezeGradOp
,
ops
::
SqueezeGradNoNeedBufferVarsInfere
nce
);
ops
::
SqueezeGradNoNeedBufferVarsInfere
r
);
REGISTER_OPERATOR
(
squeeze2
,
ops
::
Squeeze2Op
,
ops
::
Squeeze2OpMaker
,
REGISTER_OPERATOR
(
squeeze2
,
ops
::
Squeeze2Op
,
ops
::
Squeeze2OpMaker
,
ops
::
Squeeze2GradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
Squeeze2GradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
...
...
paddle/fluid/operators/strided_slice_op.cc
浏览文件 @
a6fbba65
...
@@ -304,7 +304,7 @@ class StridedSliceOpGradMaker : public framework::SingleGradOpMaker<T> {
...
@@ -304,7 +304,7 @@ class StridedSliceOpGradMaker : public framework::SingleGradOpMaker<T> {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
StridedSliceOpGradNoNeedBufferVarsInfere
nce
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
StridedSliceOpGradNoNeedBufferVarsInfere
r
,
"Input"
);
"Input"
);
}
// namespace operators
}
// namespace operators
...
@@ -315,7 +315,7 @@ REGISTER_OPERATOR(strided_slice, ops::StridedSliceOp, ops::StridedSliceOpMaker,
...
@@ -315,7 +315,7 @@ REGISTER_OPERATOR(strided_slice, ops::StridedSliceOp, ops::StridedSliceOpMaker,
ops
::
StridedSliceOpGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
StridedSliceOpGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
StridedSliceOpGradMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
StridedSliceOpGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
strided_slice_grad
,
ops
::
StridedSliceOpGrad
,
REGISTER_OPERATOR
(
strided_slice_grad
,
ops
::
StridedSliceOpGrad
,
ops
::
StridedSliceOpGradNoNeedBufferVarsInfere
nce
);
ops
::
StridedSliceOpGradNoNeedBufferVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
strided_slice
,
strided_slice
,
...
...
paddle/fluid/operators/trace_op.cc
浏览文件 @
a6fbba65
...
@@ -147,8 +147,7 @@ class TraceGradOpMaker : public framework::SingleGradOpMaker<T> {
...
@@ -147,8 +147,7 @@ class TraceGradOpMaker : public framework::SingleGradOpMaker<T> {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
TraceGradNoNeedBufferVarsInference
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
TraceGradNoNeedBufferVarsInferer
,
"Input"
);
"Input"
);
}
// namespace operators
}
// namespace operators
}
// namespace paddle
}
// namespace paddle
...
@@ -159,7 +158,7 @@ REGISTER_OPERATOR(trace, ops::TraceOp, ops::TraceOpMaker,
...
@@ -159,7 +158,7 @@ REGISTER_OPERATOR(trace, ops::TraceOp, ops::TraceOpMaker,
ops
::
TraceGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
TraceGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
trace_grad
,
ops
::
TraceOpGrad
,
REGISTER_OPERATOR
(
trace_grad
,
ops
::
TraceOpGrad
,
ops
::
TraceGradNoNeedBufferVarsInfere
nce
);
ops
::
TraceGradNoNeedBufferVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
trace
,
ops
::
TraceKernel
<
paddle
::
platform
::
CPUDeviceContext
,
int
>
,
trace
,
ops
::
TraceKernel
<
paddle
::
platform
::
CPUDeviceContext
,
int
>
,
ops
::
TraceKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
ops
::
TraceKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
...
...
paddle/fluid/operators/unfold_op.cc
浏览文件 @
a6fbba65
...
@@ -174,7 +174,7 @@ class UnfoldGradMaker : public framework::SingleGradOpMaker<T> {
...
@@ -174,7 +174,7 @@ class UnfoldGradMaker : public framework::SingleGradOpMaker<T> {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
UnfoldGradOpNoNeedBufferVarsInfere
nce
,
"X"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
UnfoldGradOpNoNeedBufferVarsInfere
r
,
"X"
);
}
// namespace operators
}
// namespace operators
}
// namespace paddle
}
// namespace paddle
...
@@ -184,7 +184,7 @@ REGISTER_OPERATOR(unfold, ops::UnfoldOp, ops::UnfoldOpMaker,
...
@@ -184,7 +184,7 @@ REGISTER_OPERATOR(unfold, ops::UnfoldOp, ops::UnfoldOpMaker,
ops
::
UnfoldGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
UnfoldGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
UnfoldGradMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
UnfoldGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
unfold_grad
,
ops
::
UnfoldGradOp
,
REGISTER_OPERATOR
(
unfold_grad
,
ops
::
UnfoldGradOp
,
ops
::
UnfoldGradOpNoNeedBufferVarsInfere
nce
);
ops
::
UnfoldGradOpNoNeedBufferVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
unfold
,
ops
::
UnfoldOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
unfold
,
ops
::
UnfoldOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
...
...
paddle/fluid/operators/unsqueeze_op.cc
浏览文件 @
a6fbba65
...
@@ -306,8 +306,7 @@ DECLARE_INPLACE_OP_INFERER(UnsqueezeInplaceInferer, {"X", "Out"});
...
@@ -306,8 +306,7 @@ DECLARE_INPLACE_OP_INFERER(UnsqueezeInplaceInferer, {"X", "Out"});
DECLARE_INPLACE_OP_INFERER
(
UnsqueezeGradInplaceInferer
,
DECLARE_INPLACE_OP_INFERER
(
UnsqueezeGradInplaceInferer
,
{
framework
::
GradVarName
(
"Out"
),
{
framework
::
GradVarName
(
"Out"
),
framework
::
GradVarName
(
"X"
)});
framework
::
GradVarName
(
"X"
)});
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
UnsqueezeGradOpNoNeedBufferVarInference
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
UnsqueezeGradOpNoNeedBufferVarInferer
,
"X"
);
"X"
);
}
// namespace operators
}
// namespace operators
}
// namespace paddle
}
// namespace paddle
...
@@ -316,7 +315,7 @@ REGISTER_OPERATOR(unsqueeze, ops::UnsqueezeOp, ops::UnsqueezeOpMaker,
...
@@ -316,7 +315,7 @@ REGISTER_OPERATOR(unsqueeze, ops::UnsqueezeOp, ops::UnsqueezeOpMaker,
ops
::
UnsqueezeGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
UnsqueezeGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
UnsqueezeGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
UnsqueezeGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
unsqueeze_grad
,
ops
::
UnsqueezeGradOp
,
REGISTER_OPERATOR
(
unsqueeze_grad
,
ops
::
UnsqueezeGradOp
,
ops
::
UnsqueezeGradOpNoNeedBufferVarInfere
nce
);
ops
::
UnsqueezeGradOpNoNeedBufferVarInfere
r
);
REGISTER_OPERATOR
(
unsqueeze2
,
ops
::
Unsqueeze2Op
,
ops
::
Unsqueeze2OpMaker
,
REGISTER_OPERATOR
(
unsqueeze2
,
ops
::
Unsqueeze2Op
,
ops
::
Unsqueeze2OpMaker
,
ops
::
Unsqueeze2GradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
Unsqueeze2GradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
...
...
paddle/fluid/operators/warpctc_op.cc
浏览文件 @
a6fbba65
...
@@ -184,7 +184,7 @@ class WarpCTCGradOp : public framework::OperatorWithKernel {
...
@@ -184,7 +184,7 @@ class WarpCTCGradOp : public framework::OperatorWithKernel {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
WarpCTCGradOpNoNeedBufferVarInfere
nce
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
WarpCTCGradOpNoNeedBufferVarInfere
r
,
"Logits"
);
"Logits"
);
}
// namespace operators
}
// namespace operators
...
@@ -195,7 +195,7 @@ REGISTER_OPERATOR(warpctc, ops::WarpCTCOp, ops::WarpCTCOpMaker,
...
@@ -195,7 +195,7 @@ REGISTER_OPERATOR(warpctc, ops::WarpCTCOp, ops::WarpCTCOpMaker,
ops
::
WarpCTCGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
WarpCTCGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
WarpCTCGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
WarpCTCGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
warpctc_grad
,
ops
::
WarpCTCGradOp
,
REGISTER_OPERATOR
(
warpctc_grad
,
ops
::
WarpCTCGradOp
,
ops
::
WarpCTCGradOpNoNeedBufferVarInfere
nce
);
ops
::
WarpCTCGradOpNoNeedBufferVarInfere
r
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
warpctc
,
ops
::
WarpCTCKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
);
warpctc
,
ops
::
WarpCTCKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
...
...
paddle/fluid/operators/where_op.cc
浏览文件 @
a6fbba65
...
@@ -135,8 +135,7 @@ class WhereOpGradMaker : public framework::SingleGradOpMaker<T> {
...
@@ -135,8 +135,7 @@ class WhereOpGradMaker : public framework::SingleGradOpMaker<T> {
}
}
};
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
WhereGradNoNeedBufferVarsInference
,
"X"
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
WhereGradNoNeedBufferVarsInferer
,
"X"
,
"Y"
);
"Y"
);
}
// namespace operators
}
// namespace operators
}
// namespace paddle
}
// namespace paddle
...
@@ -146,7 +145,7 @@ REGISTER_OPERATOR(where, ops::WhereOp, ops::WhereOpMaker,
...
@@ -146,7 +145,7 @@ REGISTER_OPERATOR(where, ops::WhereOp, ops::WhereOpMaker,
ops
::
WhereOpGradMaker
<
paddle
::
imperative
::
OpBase
>
);
ops
::
WhereOpGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
where_grad
,
ops
::
WhereGradOp
,
REGISTER_OPERATOR
(
where_grad
,
ops
::
WhereGradOp
,
ops
::
WhereGradNoNeedBufferVarsInfere
nce
);
ops
::
WhereGradNoNeedBufferVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
REGISTER_OP_CPU_KERNEL
(
where
,
ops
::
WhereKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
where
,
ops
::
WhereKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
ops
::
WhereKernel
<
paddle
::
platform
::
CPUDeviceContext
,
double
>
,
ops
::
WhereKernel
<
paddle
::
platform
::
CPUDeviceContext
,
double
>
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录