Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
b0e7439f
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
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看板
未验证
提交
b0e7439f
编写于
5月 27, 2020
作者:
L
Leo Chen
提交者:
GitHub
5月 27, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename inplace/no_need_buffer inferer, part2, test=develop (#24733)
上级
a6fbba65
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
64 addition
and
64 deletion
+64
-64
paddle/fluid/operators/activation_op.cc
paddle/fluid/operators/activation_op.cc
+16
-16
paddle/fluid/operators/argsort_op.cc
paddle/fluid/operators/argsort_op.cc
+2
-2
paddle/fluid/operators/batch_fc_op.cc
paddle/fluid/operators/batch_fc_op.cc
+2
-2
paddle/fluid/operators/batch_size_like.h
paddle/fluid/operators/batch_size_like.h
+1
-1
paddle/fluid/operators/elementwise/elementwise_add_op.cc
paddle/fluid/operators/elementwise/elementwise_add_op.cc
+4
-4
paddle/fluid/operators/elementwise/elementwise_div_op.cc
paddle/fluid/operators/elementwise/elementwise_div_op.cc
+1
-1
paddle/fluid/operators/elementwise/elementwise_mul_op.cc
paddle/fluid/operators/elementwise/elementwise_mul_op.cc
+1
-1
paddle/fluid/operators/elementwise/elementwise_op.h
paddle/fluid/operators/elementwise/elementwise_op.h
+8
-8
paddle/fluid/operators/elementwise/elementwise_sub_op.cc
paddle/fluid/operators/elementwise/elementwise_sub_op.cc
+4
-4
paddle/fluid/operators/fill_constant_batch_size_like_op.cc
paddle/fluid/operators/fill_constant_batch_size_like_op.cc
+1
-1
paddle/fluid/operators/fill_zeros_like_op.cc
paddle/fluid/operators/fill_zeros_like_op.cc
+2
-2
paddle/fluid/operators/flatten_op.cc
paddle/fluid/operators/flatten_op.cc
+8
-8
paddle/fluid/operators/gather_nd_op.cc
paddle/fluid/operators/gather_nd_op.cc
+2
-2
paddle/fluid/operators/gather_op.cc
paddle/fluid/operators/gather_op.cc
+2
-2
paddle/fluid/operators/gaussian_random_batch_size_like_op.cc
paddle/fluid/operators/gaussian_random_batch_size_like_op.cc
+1
-1
paddle/fluid/operators/group_norm_op.cc
paddle/fluid/operators/group_norm_op.cc
+4
-4
paddle/fluid/operators/gru_op.cc
paddle/fluid/operators/gru_op.cc
+2
-2
paddle/fluid/operators/gru_unit_op.cc
paddle/fluid/operators/gru_unit_op.cc
+2
-2
paddle/fluid/operators/uniform_random_batch_size_like_op.cc
paddle/fluid/operators/uniform_random_batch_size_like_op.cc
+1
-1
未找到文件。
paddle/fluid/operators/activation_op.cc
浏览文件 @
b0e7439f
...
...
@@ -822,10 +822,10 @@ class SquareDoubleGradMaker : public ::paddle::framework::SingleGradOpMaker<T> {
}
};
DECLARE_INPLACE_OP_INFERER
(
ActivationGradOpInplaceInfere
nce
,
DECLARE_INPLACE_OP_INFERER
(
ActivationGradOpInplaceInfere
r
,
{
framework
::
GradVarName
(
"Out"
),
framework
::
GradVarName
(
"X"
)});
DECLARE_INPLACE_OP_INFERER
(
ActivationDoubleGradOpInplaceInfere
nce
,
DECLARE_INPLACE_OP_INFERER
(
ActivationDoubleGradOpInplaceInfere
r
,
{
"DDX"
,
"DDOut"
});
template
<
typename
T
>
...
...
@@ -913,7 +913,7 @@ namespace plat = paddle::platform;
std::conditional<ops::CanInplaceAct<ops::grad_functor<float>>(), \
ops::ActFwdInplaceInferer, void>::type); \
REGISTER_OPERATOR(KERNEL_TYPE##_grad, ops::ActivationOpGrad, \
ops::ActivationGradOpInplaceInfere
nce
);
ops::ActivationGradOpInplaceInfere
r
);
#define REGISTER_ACTIVATION_CPU_KERNEL(act_type, op_name, functor, \
grad_functor) \
...
...
@@ -941,13 +941,13 @@ REGISTER_OPERATOR(
paddle
::
imperative
::
OpBase
>
,
ops
::
ActFwdInplaceInferer
);
REGISTER_OPERATOR
(
relu_grad
,
ops
::
ActivationOpGrad
,
ops
::
ActivationGradOpInplaceInfere
nce
,
ops
::
ActivationGradOpInplaceInfere
r
,
ops
::
ReluDoubleGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
ReluDoubleGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
relu_grad_grad
,
ops
::
ActivationOpDoubleGrad2
<
ops
::
ReluGradFunctor
<
float
>::
FwdDeps
()
>
,
ops
::
ActivationDoubleGradOpInplaceInfere
nce
);
ops
::
ActivationDoubleGradOpInplaceInfere
r
);
REGISTER_ACTIVATION_CPU_KERNEL
(
relu
,
Relu
,
ReluFunctor
,
ReluGradFunctor
);
...
...
@@ -971,13 +971,13 @@ REGISTER_OPERATOR(
paddle
::
imperative
::
OpBase
>
,
ops
::
ActFwdInplaceInferer
);
REGISTER_OPERATOR
(
leaky_relu_grad
,
ops
::
ActivationOpGrad
,
ops
::
ActivationGradOpInplaceInfere
nce
,
ops
::
ActivationGradOpInplaceInfere
r
,
ops
::
LeakyReluDoubleGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
LeakyReluDoubleGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
leaky_relu_grad_grad
,
ops
::
ActivationOpDoubleGrad2
<
ops
::
LeakyReluGradFunctor
<
float
>::
FwdDeps
()
>
,
ops
::
ActivationDoubleGradOpInplaceInfere
nce
);
ops
::
ActivationDoubleGradOpInplaceInfere
r
);
REGISTER_ACTIVATION_CPU_KERNEL
(
leaky_relu
,
LeakyRelu
,
LeakyReluFunctor
,
LeakyReluGradFunctor
);
...
...
@@ -1000,13 +1000,13 @@ REGISTER_OPERATOR(
paddle
::
imperative
::
OpBase
>
,
ops
::
ActFwdInplaceInferer
);
REGISTER_OPERATOR
(
elu_grad
,
ops
::
ActivationOpGrad
,
ops
::
ActivationGradOpInplaceInfere
nce
,
ops
::
ActivationGradOpInplaceInfere
r
,
ops
::
ELUDoubleGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
ELUDoubleGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
elu_grad_grad
,
ops
::
ActivationOpDoubleGrad
<
ops
::
ELUGradFunctor
<
float
>::
FwdDeps
()
>
,
ops
::
ActivationDoubleGradOpInplaceInfere
nce
);
ops
::
ActivationDoubleGradOpInplaceInfere
r
);
REGISTER_ACTIVATION_CPU_KERNEL
(
elu
,
ELU
,
ELUFunctor
,
ELUGradFunctor
);
REGISTER_OP_CPU_KERNEL
(
...
...
@@ -1028,13 +1028,13 @@ REGISTER_OPERATOR(
paddle
::
imperative
::
OpBase
>
,
ops
::
ActFwdInplaceInferer
);
REGISTER_OPERATOR
(
sqrt_grad
,
ops
::
ActivationOpGrad
,
ops
::
ActivationGradOpInplaceInfere
nce
,
ops
::
ActivationGradOpInplaceInfere
r
,
ops
::
SqrtDoubleGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SqrtDoubleGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
sqrt_grad_grad
,
ops
::
ActivationOpDoubleGrad
<
ops
::
SqrtGradGradFunctor
<
float
>::
FwdDeps
()
>
,
ops
::
ActivationDoubleGradOpInplaceInfere
nce
);
ops
::
ActivationDoubleGradOpInplaceInfere
r
);
REGISTER_ACTIVATION_CPU_KERNEL
(
sqrt
,
Sqrt
,
SqrtFunctor
,
SqrtGradFunctor
);
REGISTER_OP_CPU_KERNEL
(
...
...
@@ -1056,13 +1056,13 @@ REGISTER_OPERATOR(
paddle
::
imperative
::
OpBase
>
,
ops
::
ActFwdInplaceInferer
);
REGISTER_OPERATOR
(
square_grad
,
ops
::
ActivationOpGrad
,
ops
::
ActivationGradOpInplaceInfere
nce
,
ops
::
ActivationGradOpInplaceInfere
r
,
ops
::
SquareDoubleGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
SquareDoubleGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
square_grad_grad
,
ops
::
ActivationOpDoubleGrad
<
ops
::
SquareGradGradFunctor
<
float
>::
FwdDeps
()
>
,
ops
::
ActivationDoubleGradOpInplaceInfere
nce
);
ops
::
ActivationDoubleGradOpInplaceInfere
r
);
REGISTER_OP_CPU_KERNEL
(
square
,
ops
::
ActivationKernel
<
paddle
::
platform
::
CPUDeviceContext
,
...
...
@@ -1106,7 +1106,7 @@ REGISTER_OPERATOR(
std
::
conditional
<
ops
::
CanInplaceAct
<
ops
::
PowGradFunctor
<
float
>>
(),
ops
::
ActFwdInplaceInferer
,
void
>::
type
);
REGISTER_OPERATOR
(
pow_grad
,
ops
::
PowOpGrad
,
ops
::
ActivationGradOpInplaceInfere
nce
);
ops
::
ActivationGradOpInplaceInfere
r
);
REGISTER_OP_CPU_KERNEL
(
pow
,
ops
::
PowKernel
<
plat
::
CPUDeviceContext
,
ops
::
PowFunctor
<
float
>>
,
...
...
@@ -1131,7 +1131,7 @@ REGISTER_OPERATOR(
std
::
conditional
<
ops
::
CanInplaceAct
<
ops
::
ExpGradFunctor
<
float
>>
(),
ops
::
ActFwdInplaceInferer
,
void
>::
type
);
REGISTER_OPERATOR
(
exp_grad
,
ops
::
ActivationOpGrad
,
ops
::
ActivationGradOpInplaceInfere
nce
);
ops
::
ActivationGradOpInplaceInfere
r
);
REGISTER_OP_CPU_KERNEL
(
exp
,
ops
::
ActivationKernel
<
paddle
::
platform
::
CPUDeviceContext
,
...
...
@@ -1163,7 +1163,7 @@ REGISTER_OPERATOR(
std
::
conditional
<
ops
::
CanInplaceAct
<
ops
::
AbsGradFunctor
<
float
>>
(),
ops
::
ActFwdInplaceInferer
,
void
>::
type
);
REGISTER_OPERATOR
(
abs_grad
,
ops
::
ActivationOpGrad
,
ops
::
ActivationGradOpInplaceInfere
nce
);
ops
::
ActivationGradOpInplaceInfere
r
);
REGISTER_OP_CPU_KERNEL
(
abs
,
ops
::
ActivationKernel
<
paddle
::
platform
::
CPUDeviceContext
,
...
...
paddle/fluid/operators/argsort_op.cc
浏览文件 @
b0e7439f
...
...
@@ -116,7 +116,7 @@ class ArgsortGradOpMaker : public framework::SingleGradOpMaker<T> {
}
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
ArgsortGradNoNeedBufferVar
Inference
,
"X"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
ArgsortGradNoNeedBufferVar
sInferer
,
"X"
);
}
// namespace operators
}
// namespace paddle
...
...
@@ -126,7 +126,7 @@ REGISTER_OPERATOR(argsort, ops::ArgsortOp, ops::ArgsortOpMaker,
ops
::
ArgsortGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
ArgsortGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
argsort_grad
,
ops
::
ArgsortGradOp
,
ops
::
ArgsortGradNoNeedBufferVar
Inference
);
ops
::
ArgsortGradNoNeedBufferVar
sInferer
);
REGISTER_OP_CPU_KERNEL
(
argsort
,
ops
::
ArgsortKernel
<
paddle
::
platform
::
CPUPlace
,
float
>
,
ops
::
ArgsortKernel
<
paddle
::
platform
::
CPUPlace
,
double
>
,
...
...
paddle/fluid/operators/batch_fc_op.cc
浏览文件 @
b0e7439f
...
...
@@ -136,7 +136,7 @@ class BatchFCGradOpMaker : public framework::SingleGradOpMaker<T> {
op
->
SetAttrMap
(
this
->
Attrs
());
}
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
BatchFCGradOpNoNeedBufferVarsInfere
nce
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
BatchFCGradOpNoNeedBufferVarsInfere
r
,
"Bias"
);
}
// namespace operators
...
...
@@ -148,7 +148,7 @@ REGISTER_OPERATOR(batch_fc, ops::BatchFCOp, ops::BatchFCOpMaker,
ops
::
BatchFCGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
batch_fc_grad
,
ops
::
BatchFCGradOp
,
ops
::
BatchFCGradOpNoNeedBufferVarsInfere
nce
);
ops
::
BatchFCGradOpNoNeedBufferVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
batch_fc
,
ops
::
BatchFCKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
...
...
paddle/fluid/operators/batch_size_like.h
浏览文件 @
b0e7439f
...
...
@@ -74,7 +74,7 @@ class BatchSizeLikeOpMaker : public framework::OpProtoAndCheckerMaker {
virtual
void
Apply
()
=
0
;
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
BatchSizeLikeNoNeedBufferVarsInfere
nce
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
BatchSizeLikeNoNeedBufferVarsInfere
r
,
"Input"
);
}
// namespace operators
...
...
paddle/fluid/operators/elementwise/elementwise_add_op.cc
浏览文件 @
b0e7439f
...
...
@@ -97,15 +97,15 @@ REGISTER_ELEMWISE_EXPLICIT_OP_WITHOUT_GRAD(elementwise_add, Add);
namespace
ops
=
paddle
::
operators
;
REGISTER_OPERATOR
(
elementwise_add_grad
,
ops
::
ElementwiseOpGrad
,
ops
::
ElementwiseGradOpInplace
,
ops
::
ElementwiseGrad
NoBufVarsInference
,
elementwise_add_grad
,
ops
::
ElementwiseOpGrad
,
ops
::
ElementwiseGrad
OpInplaceInferer
,
ops
::
ElementwiseGradNoBufVarsInferer
,
ops
::
ElementwiseAddDoubleGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
ElementwiseAddDoubleGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
elementwise_add_grad_grad
,
ops
::
ElementwiseOpDoubleGradWithoutDXDY
,
ops
::
ElementwiseDoubleGradOpInplace
,
ops
::
ElementwiseDoubleGradNoBufVarsInfere
nce
);
ops
::
ElementwiseDoubleGradOpInplace
Inferer
,
ops
::
ElementwiseDoubleGradNoBufVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
elementwise_add
,
...
...
paddle/fluid/operators/elementwise/elementwise_div_op.cc
浏览文件 @
b0e7439f
...
...
@@ -123,7 +123,7 @@ REGISTER_OPERATOR(
ops
::
ElementwiseDivDoubleGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
elementwise_div_grad_grad
,
ops
::
ElementwiseDivOpDoubleGrad
,
ops
::
ElementwiseDoubleGradOpInplace
);
ops
::
ElementwiseDoubleGradOpInplace
Inferer
);
REGISTER_OP_CPU_KERNEL
(
elementwise_div
,
...
...
paddle/fluid/operators/elementwise/elementwise_mul_op.cc
浏览文件 @
b0e7439f
...
...
@@ -123,7 +123,7 @@ REGISTER_OPERATOR(
ops
::
ElementwiseMulDoubleGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
elementwise_mul_grad_grad
,
ops
::
ElementwiseOpDoubleGrad
,
ops
::
ElementwiseDoubleGradOpInplace
);
ops
::
ElementwiseDoubleGradOpInplace
Inferer
);
REGISTER_OP_CPU_KERNEL
(
elementwise_mul
,
...
...
paddle/fluid/operators/elementwise/elementwise_op.h
浏览文件 @
b0e7439f
...
...
@@ -348,16 +348,16 @@ class ElemwiseGradKernel : public framework::OpKernel<T> {
}
};
DECLARE_INPLACE_OP_INFERER
(
ElementwiseOpInplace
,
{
"X"
,
"Out"
});
DECLARE_INPLACE_OP_INFERER
(
ElementwiseGradOpInplace
,
DECLARE_INPLACE_OP_INFERER
(
ElementwiseOpInplace
Inferer
,
{
"X"
,
"Out"
});
DECLARE_INPLACE_OP_INFERER
(
ElementwiseGradOpInplace
Inferer
,
{
framework
::
GradVarName
(
"Out"
),
framework
::
GradVarName
(
"X"
)});
DECLARE_INPLACE_OP_INFERER
(
ElementwiseDoubleGradOpInplace
,
{
"DDX"
,
"DDOut"
});
DECLARE_INPLACE_OP_INFERER
(
ElementwiseDoubleGradOpInplaceInferer
,
{
"DDX"
,
"DDOut"
});
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
ElementwiseGradNoBufVarsInference
,
"X"
,
"Y"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
ElementwiseDoubleGradNoBufVarsInference
,
"Y"
,
"DOut"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
ElementwiseGradNoBufVarsInferer
,
"X"
,
"Y"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
ElementwiseDoubleGradNoBufVarsInferer
,
"Y"
,
"DOut"
);
}
// namespace operators
}
// namespace paddle
...
...
@@ -389,4 +389,4 @@ DECLARE_NO_NEED_BUFFER_VARS_INFERER(ElementwiseDoubleGradNoBufVarsInference,
::paddle::operators::ElementwiseOpInferVarType, \
op_type##GradMaker<::paddle::framework::OpDesc>, \
op_type##GradMaker<::paddle::imperative::OpBase>, \
::paddle::operators::ElementwiseOpInplace);
::paddle::operators::ElementwiseOpInplace
Inferer
);
paddle/fluid/operators/elementwise/elementwise_sub_op.cc
浏览文件 @
b0e7439f
...
...
@@ -97,14 +97,14 @@ REGISTER_ELEMWISE_EXPLICIT_OP_WITHOUT_GRAD(elementwise_sub, Sub);
namespace
ops
=
paddle
::
operators
;
REGISTER_OPERATOR
(
elementwise_sub_grad
,
ops
::
ElementwiseOpGrad
,
ops
::
ElementwiseGradOpInplace
,
ops
::
ElementwiseGrad
NoBufVarsInference
,
elementwise_sub_grad
,
ops
::
ElementwiseOpGrad
,
ops
::
ElementwiseGrad
OpInplaceInferer
,
ops
::
ElementwiseGradNoBufVarsInferer
,
ops
::
ElementwiseSubDoubleGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
ElementwiseSubDoubleGradMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
elementwise_sub_grad_grad
,
ops
::
ElementwiseOpDoubleGradWithoutDXDY
,
ops
::
ElementwiseDoubleGradOpInplace
,
ops
::
ElementwiseDoubleGradNoBufVarsInfere
nce
);
ops
::
ElementwiseDoubleGradOpInplace
Inferer
,
ops
::
ElementwiseDoubleGradNoBufVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
elementwise_sub
,
...
...
paddle/fluid/operators/fill_constant_batch_size_like_op.cc
浏览文件 @
b0e7439f
...
...
@@ -63,7 +63,7 @@ REGISTER_OPERATOR(
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
FillConstantBatchSizeLikeOpMaker
,
ops
::
BatchSizeLikeNoNeedBufferVarsInfere
nce
);
ops
::
BatchSizeLikeNoNeedBufferVarsInfere
r
);
REGISTER_OP_CPU_KERNEL
(
fill_constant_batch_size_like
,
ops
::
FillConstantBatchSizeLikeOpKernel
<
paddle
::
platform
::
CPUDeviceContext
,
...
...
paddle/fluid/operators/fill_zeros_like_op.cc
浏览文件 @
b0e7439f
...
...
@@ -71,7 +71,7 @@ class FillZerosLikeOp2Maker : public FillZerosLikeOpMaker {
}
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
FillZerosLikeOp2NoNeedBufferVarsInfere
nce
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
FillZerosLikeOp2NoNeedBufferVarsInfere
r
,
"X"
);
}
// namespace operators
...
...
@@ -83,7 +83,7 @@ REGISTER_OP_WITHOUT_GRADIENT(fill_zeros_like, ops::FillZerosLikeOp,
REGISTER_OPERATOR
(
fill_zeros_like2
,
ops
::
FillZerosLikeOp2
,
ops
::
FillZerosLikeOp2Maker
,
ops
::
FillZerosLikeOp2NoNeedBufferVarsInfere
nce
,
ops
::
FillZerosLikeOp2NoNeedBufferVarsInfere
r
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
...
...
paddle/fluid/operators/flatten_op.cc
浏览文件 @
b0e7439f
...
...
@@ -241,11 +241,11 @@ class Flatten2GradOp : public framework::OperatorWithKernel {
}
};
DECLARE_INPLACE_OP_INFERER
(
FlattenOpInplaceIn
ToOut
,
{
"X"
,
"Out"
});
DECLARE_INPLACE_OP_INFERER
(
FlattenGradInplace
inToOut
,
DECLARE_INPLACE_OP_INFERER
(
FlattenOpInplaceIn
ferer
,
{
"X"
,
"Out"
});
DECLARE_INPLACE_OP_INFERER
(
FlattenGradInplace
Inferer
,
{
framework
::
GradVarName
(
"Out"
),
framework
::
GradVarName
(
"X"
)});
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
FlattenGradNoNeedBufferVarsInfere
nce
,
"X"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
FlattenGradNoNeedBufferVarsInfere
r
,
"X"
);
}
// namespace operators
}
// namespace paddle
...
...
@@ -254,17 +254,17 @@ namespace ops = paddle::operators;
REGISTER_OPERATOR
(
flatten
,
ops
::
FlattenOp
,
ops
::
FlattenOpMaker
,
ops
::
FlattenGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
FlattenGradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
FlattenOpInplaceIn
ToOut
);
ops
::
FlattenOpInplaceIn
ferer
);
REGISTER_OPERATOR
(
flatten_grad
,
ops
::
FlattenGradOp
,
ops
::
FlattenGradInplace
inToOut
,
ops
::
FlattenGradNoNeedBufferVarsInfere
nce
);
ops
::
FlattenGradInplace
Inferer
,
ops
::
FlattenGradNoNeedBufferVarsInfere
r
);
REGISTER_OPERATOR
(
flatten2
,
ops
::
Flatten2Op
,
ops
::
Flatten2OpMaker
,
ops
::
Flatten2GradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
Flatten2GradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
FlattenOpInplaceIn
ToOut
);
ops
::
FlattenOpInplaceIn
ferer
);
REGISTER_OPERATOR
(
flatten2_grad
,
ops
::
Flatten2GradOp
,
ops
::
FlattenGradInplace
inToOut
);
ops
::
FlattenGradInplace
Inferer
);
REGISTER_OP_CPU_KERNEL
(
flatten
,
ops
::
FlattenKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
...
...
paddle/fluid/operators/gather_nd_op.cc
浏览文件 @
b0e7439f
...
...
@@ -166,7 +166,7 @@ class GatherNdGradOpMaker : public framework::SingleGradOpMaker<T> {
}
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
GatherNdGradNoNeedBufferVarInfere
nce
,
"X"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
GatherNdGradNoNeedBufferVarInfere
r
,
"X"
);
}
// namespace operators
}
// namespace paddle
...
...
@@ -178,7 +178,7 @@ REGISTER_OPERATOR(gather_nd, ops::GatherNdOp, ops::GatherNdOpMaker,
ops
::
GatherNdGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
gather_nd_grad
,
ops
::
GatherNdGradOp
,
ops
::
GatherNdGradNoNeedBufferVarInfere
nce
);
ops
::
GatherNdGradNoNeedBufferVarInfere
r
);
REGISTER_OP_CPU_KERNEL
(
gather_nd
,
ops
::
GatherNdOpKernel
<
float
>
,
ops
::
GatherNdOpKernel
<
double
>
,
...
...
paddle/fluid/operators/gather_op.cc
浏览文件 @
b0e7439f
...
...
@@ -127,7 +127,7 @@ class GatherGradOpMaker : public framework::SingleGradOpMaker<T> {
}
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
GatherGradNoNeedBufferVarInfere
nce
,
"X"
);
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
GatherGradNoNeedBufferVarInfere
r
,
"X"
);
}
// namespace operators
}
// namespace paddle
...
...
@@ -137,7 +137,7 @@ REGISTER_OPERATOR(gather, ops::GatherOp, ops::GatherOpMaker,
ops
::
GatherGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
GatherGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
gather_grad
,
ops
::
GatherGradOp
,
ops
::
GatherGradNoNeedBufferVarInfere
nce
);
ops
::
GatherGradNoNeedBufferVarInfere
r
);
REGISTER_OP_CPU_KERNEL
(
gather
,
ops
::
GatherOpKernel
<
float
>
,
ops
::
GatherOpKernel
<
double
>
,
ops
::
GatherOpKernel
<
int
>
,
ops
::
GatherOpKernel
<
uint8_t
>
,
...
...
paddle/fluid/operators/gaussian_random_batch_size_like_op.cc
浏览文件 @
b0e7439f
...
...
@@ -74,6 +74,6 @@ REGISTER_OPERATOR(
paddle
::
operators
::
GaussianRandomBatchSizeLikeOpMaker
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
paddle
::
operators
::
BatchSizeLikeNoNeedBufferVarsInfere
nce
);
paddle
::
operators
::
BatchSizeLikeNoNeedBufferVarsInfere
r
);
// Kernels are registered in gaussian_random_op.cc and gaussian_random_op.cu
paddle/fluid/operators/group_norm_op.cc
浏览文件 @
b0e7439f
...
...
@@ -216,8 +216,8 @@ class GroupNormGradMaker : public framework::SingleGradOpMaker<T> {
}
};
DECLARE_INPLACE_OP_INFERER
(
GroupNormInplaceIn
ToOut
,
{
"X"
,
"Y"
});
DECLARE_INPLACE_OP_INFERER
(
GroupNormGradInplaceIn
ToOut
,
DECLARE_INPLACE_OP_INFERER
(
GroupNormInplaceIn
ferer
,
{
"X"
,
"Y"
});
DECLARE_INPLACE_OP_INFERER
(
GroupNormGradInplaceIn
ferer
,
{
framework
::
GradVarName
(
"Y"
),
framework
::
GradVarName
(
"X"
)});
...
...
@@ -239,9 +239,9 @@ REGISTER_OPERATOR(group_norm, ops::GroupNormOp, ops::GroupNormOpMaker,
ops
::
GroupNormOpInferVarType
,
ops
::
GroupNormGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
GroupNormGradMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
GroupNormInplaceIn
ToOut
);
ops
::
GroupNormInplaceIn
ferer
);
REGISTER_OPERATOR
(
group_norm_grad
,
ops
::
GroupNormGradOp
,
ops
::
GroupNormGradInplaceIn
ToOut
);
ops
::
GroupNormGradInplaceIn
ferer
);
REGISTER_OP_CPU_KERNEL
(
group_norm
,
ops
::
GroupNormKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
ops
::
GroupNormKernel
<
paddle
::
platform
::
CPUDeviceContext
,
double
>
);
...
...
paddle/fluid/operators/gru_op.cc
浏览文件 @
b0e7439f
...
...
@@ -456,7 +456,7 @@ class GRUGradOpMaker : public framework::SingleGradOpMaker<T> {
}
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
GRUGradOpNoNeedBufferVarInfere
nce
,
"Input"
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
GRUGradOpNoNeedBufferVarInfere
r
,
"Input"
,
"Bias"
);
}
// namespace operators
...
...
@@ -467,7 +467,7 @@ REGISTER_OPERATOR(gru, ops::GRUOp, ops::GRUOpMaker,
ops
::
GRUGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
GRUGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
gru_grad
,
ops
::
GRUGradOp
,
ops
::
GRUGradOpNoNeedBufferVarInfere
nce
);
ops
::
GRUGradOpNoNeedBufferVarInfere
r
);
REGISTER_OP_CPU_KERNEL
(
gru
,
ops
::
GRUCPUKernel
<
float
>
,
ops
::
GRUCPUKernel
<
double
>
);
REGISTER_OP_CPU_KERNEL
(
...
...
paddle/fluid/operators/gru_unit_op.cc
浏览文件 @
b0e7439f
...
...
@@ -234,7 +234,7 @@ class GRUUnitGradOpMaker : public framework::SingleGradOpMaker<T> {
}
};
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
GRUUnitGradOpNoNeedBufferVarInfere
nce
,
DECLARE_NO_NEED_BUFFER_VARS_INFERER
(
GRUUnitGradOpNoNeedBufferVarInfere
r
,
"Bias"
);
}
// namespace operators
...
...
@@ -246,7 +246,7 @@ REGISTER_OPERATOR(gru_unit, ops::GRUUnitOp, ops::GRUUnitOpMaker,
ops
::
GRUUnitGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
GRUUnitGradOpMaker
<
paddle
::
imperative
::
OpBase
>
);
REGISTER_OPERATOR
(
gru_unit_grad
,
ops
::
GRUUnitGradOp
,
ops
::
GRUUnitGradOpNoNeedBufferVarInfere
nce
);
ops
::
GRUUnitGradOpNoNeedBufferVarInfere
r
);
REGISTER_OP_CPU_KERNEL
(
gru_unit
,
ops
::
GRUUnitKernel
<
paddle
::
platform
::
CPUDeviceContext
,
float
>
,
...
...
paddle/fluid/operators/uniform_random_batch_size_like_op.cc
浏览文件 @
b0e7439f
...
...
@@ -78,5 +78,5 @@ REGISTER_OPERATOR(
paddle
::
operators
::
UniformRandomBatchSizeLikeOpMaker
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
paddle
::
operators
::
BatchSizeLikeNoNeedBufferVarsInfere
nce
);
paddle
::
operators
::
BatchSizeLikeNoNeedBufferVarsInfere
r
);
// Kernels are registered in uniform_random_op.cc and uniform_random_op.cu
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录