From b0e7439fbcfaa32151c4ac05e1489796c96c5440 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Wed, 27 May 2020 20:48:33 +0800 Subject: [PATCH] rename inplace/no_need_buffer inferer, part2, test=develop (#24733) --- paddle/fluid/operators/activation_op.cc | 32 +++++++++---------- paddle/fluid/operators/argsort_op.cc | 4 +-- paddle/fluid/operators/batch_fc_op.cc | 4 +-- paddle/fluid/operators/batch_size_like.h | 2 +- .../elementwise/elementwise_add_op.cc | 8 ++--- .../elementwise/elementwise_div_op.cc | 2 +- .../elementwise/elementwise_mul_op.cc | 2 +- .../operators/elementwise/elementwise_op.h | 16 +++++----- .../elementwise/elementwise_sub_op.cc | 8 ++--- .../fill_constant_batch_size_like_op.cc | 2 +- paddle/fluid/operators/fill_zeros_like_op.cc | 4 +-- paddle/fluid/operators/flatten_op.cc | 16 +++++----- paddle/fluid/operators/gather_nd_op.cc | 4 +-- paddle/fluid/operators/gather_op.cc | 4 +-- .../gaussian_random_batch_size_like_op.cc | 2 +- paddle/fluid/operators/group_norm_op.cc | 8 ++--- paddle/fluid/operators/gru_op.cc | 4 +-- paddle/fluid/operators/gru_unit_op.cc | 4 +-- .../uniform_random_batch_size_like_op.cc | 2 +- 19 files changed, 64 insertions(+), 64 deletions(-) diff --git a/paddle/fluid/operators/activation_op.cc b/paddle/fluid/operators/activation_op.cc index fd5f7e06b1..59055a8679 100644 --- a/paddle/fluid/operators/activation_op.cc +++ b/paddle/fluid/operators/activation_op.cc @@ -822,10 +822,10 @@ class SquareDoubleGradMaker : public ::paddle::framework::SingleGradOpMaker { } }; -DECLARE_INPLACE_OP_INFERER(ActivationGradOpInplaceInference, +DECLARE_INPLACE_OP_INFERER(ActivationGradOpInplaceInferer, {framework::GradVarName("Out"), framework::GradVarName("X")}); -DECLARE_INPLACE_OP_INFERER(ActivationDoubleGradOpInplaceInference, +DECLARE_INPLACE_OP_INFERER(ActivationDoubleGradOpInplaceInferer, {"DDX", "DDOut"}); template @@ -913,7 +913,7 @@ namespace plat = paddle::platform; std::conditional>(), \ ops::ActFwdInplaceInferer, void>::type); \ REGISTER_OPERATOR(KERNEL_TYPE##_grad, ops::ActivationOpGrad, \ - ops::ActivationGradOpInplaceInference); + ops::ActivationGradOpInplaceInferer); #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::ActivationGradOpInplaceInference, + ops::ActivationGradOpInplaceInferer, ops::ReluDoubleGradMaker, ops::ReluDoubleGradMaker); REGISTER_OPERATOR( relu_grad_grad, ops::ActivationOpDoubleGrad2::FwdDeps()>, - ops::ActivationDoubleGradOpInplaceInference); + ops::ActivationDoubleGradOpInplaceInferer); 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::ActivationGradOpInplaceInference, + ops::ActivationGradOpInplaceInferer, ops::LeakyReluDoubleGradMaker, ops::LeakyReluDoubleGradMaker); REGISTER_OPERATOR( leaky_relu_grad_grad, ops::ActivationOpDoubleGrad2::FwdDeps()>, - ops::ActivationDoubleGradOpInplaceInference); + ops::ActivationDoubleGradOpInplaceInferer); 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::ActivationGradOpInplaceInference, + ops::ActivationGradOpInplaceInferer, ops::ELUDoubleGradMaker, ops::ELUDoubleGradMaker); REGISTER_OPERATOR( elu_grad_grad, ops::ActivationOpDoubleGrad::FwdDeps()>, - ops::ActivationDoubleGradOpInplaceInference); + ops::ActivationDoubleGradOpInplaceInferer); 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::ActivationGradOpInplaceInference, + ops::ActivationGradOpInplaceInferer, ops::SqrtDoubleGradMaker, ops::SqrtDoubleGradMaker); REGISTER_OPERATOR( sqrt_grad_grad, ops::ActivationOpDoubleGrad::FwdDeps()>, - ops::ActivationDoubleGradOpInplaceInference); + ops::ActivationDoubleGradOpInplaceInferer); 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::ActivationGradOpInplaceInference, + ops::ActivationGradOpInplaceInferer, ops::SquareDoubleGradMaker, ops::SquareDoubleGradMaker); REGISTER_OPERATOR( square_grad_grad, ops::ActivationOpDoubleGrad::FwdDeps()>, - ops::ActivationDoubleGradOpInplaceInference); + ops::ActivationDoubleGradOpInplaceInferer); REGISTER_OP_CPU_KERNEL(square, ops::ActivationKernel>(), ops::ActFwdInplaceInferer, void>::type); REGISTER_OPERATOR(pow_grad, ops::PowOpGrad, - ops::ActivationGradOpInplaceInference); + ops::ActivationGradOpInplaceInferer); REGISTER_OP_CPU_KERNEL( pow, ops::PowKernel>, @@ -1131,7 +1131,7 @@ REGISTER_OPERATOR( std::conditional>(), ops::ActFwdInplaceInferer, void>::type); REGISTER_OPERATOR(exp_grad, ops::ActivationOpGrad, - ops::ActivationGradOpInplaceInference); + ops::ActivationGradOpInplaceInferer); REGISTER_OP_CPU_KERNEL(exp, ops::ActivationKernel>(), ops::ActFwdInplaceInferer, void>::type); REGISTER_OPERATOR(abs_grad, ops::ActivationOpGrad, - ops::ActivationGradOpInplaceInference); + ops::ActivationGradOpInplaceInferer); REGISTER_OP_CPU_KERNEL(abs, ops::ActivationKernel { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(ArgsortGradNoNeedBufferVarInference, "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(ArgsortGradNoNeedBufferVarsInferer, "X"); } // namespace operators } // namespace paddle @@ -126,7 +126,7 @@ REGISTER_OPERATOR(argsort, ops::ArgsortOp, ops::ArgsortOpMaker, ops::ArgsortGradOpMaker, ops::ArgsortGradOpMaker); REGISTER_OPERATOR(argsort_grad, ops::ArgsortGradOp, - ops::ArgsortGradNoNeedBufferVarInference); + ops::ArgsortGradNoNeedBufferVarsInferer); REGISTER_OP_CPU_KERNEL(argsort, ops::ArgsortKernel, ops::ArgsortKernel, diff --git a/paddle/fluid/operators/batch_fc_op.cc b/paddle/fluid/operators/batch_fc_op.cc index 004ebe0eb8..952625bcb6 100644 --- a/paddle/fluid/operators/batch_fc_op.cc +++ b/paddle/fluid/operators/batch_fc_op.cc @@ -136,7 +136,7 @@ class BatchFCGradOpMaker : public framework::SingleGradOpMaker { op->SetAttrMap(this->Attrs()); } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(BatchFCGradOpNoNeedBufferVarsInference, +DECLARE_NO_NEED_BUFFER_VARS_INFERER(BatchFCGradOpNoNeedBufferVarsInferer, "Bias"); } // namespace operators @@ -148,7 +148,7 @@ REGISTER_OPERATOR(batch_fc, ops::BatchFCOp, ops::BatchFCOpMaker, ops::BatchFCGradOpMaker); REGISTER_OPERATOR(batch_fc_grad, ops::BatchFCGradOp, - ops::BatchFCGradOpNoNeedBufferVarsInference); + ops::BatchFCGradOpNoNeedBufferVarsInferer); REGISTER_OP_CPU_KERNEL( batch_fc, ops::BatchFCKernel, diff --git a/paddle/fluid/operators/batch_size_like.h b/paddle/fluid/operators/batch_size_like.h index 4a693d27de..d2cf380493 100644 --- a/paddle/fluid/operators/batch_size_like.h +++ b/paddle/fluid/operators/batch_size_like.h @@ -74,7 +74,7 @@ class BatchSizeLikeOpMaker : public framework::OpProtoAndCheckerMaker { virtual void Apply() = 0; }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(BatchSizeLikeNoNeedBufferVarsInference, +DECLARE_NO_NEED_BUFFER_VARS_INFERER(BatchSizeLikeNoNeedBufferVarsInferer, "Input"); } // namespace operators diff --git a/paddle/fluid/operators/elementwise/elementwise_add_op.cc b/paddle/fluid/operators/elementwise/elementwise_add_op.cc index a12fd01e82..534a19bd94 100644 --- a/paddle/fluid/operators/elementwise/elementwise_add_op.cc +++ b/paddle/fluid/operators/elementwise/elementwise_add_op.cc @@ -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::ElementwiseGradNoBufVarsInference, + elementwise_add_grad, ops::ElementwiseOpGrad, + ops::ElementwiseGradOpInplaceInferer, ops::ElementwiseGradNoBufVarsInferer, ops::ElementwiseAddDoubleGradMaker, ops::ElementwiseAddDoubleGradMaker); REGISTER_OPERATOR(elementwise_add_grad_grad, ops::ElementwiseOpDoubleGradWithoutDXDY, - ops::ElementwiseDoubleGradOpInplace, - ops::ElementwiseDoubleGradNoBufVarsInference); + ops::ElementwiseDoubleGradOpInplaceInferer, + ops::ElementwiseDoubleGradNoBufVarsInferer); REGISTER_OP_CPU_KERNEL( elementwise_add, diff --git a/paddle/fluid/operators/elementwise/elementwise_div_op.cc b/paddle/fluid/operators/elementwise/elementwise_div_op.cc index b603bd924a..49d7158f4c 100644 --- a/paddle/fluid/operators/elementwise/elementwise_div_op.cc +++ b/paddle/fluid/operators/elementwise/elementwise_div_op.cc @@ -123,7 +123,7 @@ REGISTER_OPERATOR( ops::ElementwiseDivDoubleGradMaker); REGISTER_OPERATOR(elementwise_div_grad_grad, ops::ElementwiseDivOpDoubleGrad, - ops::ElementwiseDoubleGradOpInplace); + ops::ElementwiseDoubleGradOpInplaceInferer); REGISTER_OP_CPU_KERNEL( elementwise_div, diff --git a/paddle/fluid/operators/elementwise/elementwise_mul_op.cc b/paddle/fluid/operators/elementwise/elementwise_mul_op.cc index bedd808b84..289ea6c226 100644 --- a/paddle/fluid/operators/elementwise/elementwise_mul_op.cc +++ b/paddle/fluid/operators/elementwise/elementwise_mul_op.cc @@ -123,7 +123,7 @@ REGISTER_OPERATOR( ops::ElementwiseMulDoubleGradMaker); REGISTER_OPERATOR(elementwise_mul_grad_grad, ops::ElementwiseOpDoubleGrad, - ops::ElementwiseDoubleGradOpInplace); + ops::ElementwiseDoubleGradOpInplaceInferer); REGISTER_OP_CPU_KERNEL( elementwise_mul, diff --git a/paddle/fluid/operators/elementwise/elementwise_op.h b/paddle/fluid/operators/elementwise/elementwise_op.h index 85d501f6bf..c24b5c0208 100644 --- a/paddle/fluid/operators/elementwise/elementwise_op.h +++ b/paddle/fluid/operators/elementwise/elementwise_op.h @@ -348,16 +348,16 @@ class ElemwiseGradKernel : public framework::OpKernel { } }; -DECLARE_INPLACE_OP_INFERER(ElementwiseOpInplace, {"X", "Out"}); -DECLARE_INPLACE_OP_INFERER(ElementwiseGradOpInplace, +DECLARE_INPLACE_OP_INFERER(ElementwiseOpInplaceInferer, {"X", "Out"}); +DECLARE_INPLACE_OP_INFERER(ElementwiseGradOpInplaceInferer, {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::ElementwiseOpInplaceInferer); diff --git a/paddle/fluid/operators/elementwise/elementwise_sub_op.cc b/paddle/fluid/operators/elementwise/elementwise_sub_op.cc index a2ccd254c9..9603b022d5 100644 --- a/paddle/fluid/operators/elementwise/elementwise_sub_op.cc +++ b/paddle/fluid/operators/elementwise/elementwise_sub_op.cc @@ -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::ElementwiseGradNoBufVarsInference, + elementwise_sub_grad, ops::ElementwiseOpGrad, + ops::ElementwiseGradOpInplaceInferer, ops::ElementwiseGradNoBufVarsInferer, ops::ElementwiseSubDoubleGradMaker, ops::ElementwiseSubDoubleGradMaker); REGISTER_OPERATOR(elementwise_sub_grad_grad, ops::ElementwiseOpDoubleGradWithoutDXDY, - ops::ElementwiseDoubleGradOpInplace, - ops::ElementwiseDoubleGradNoBufVarsInference); + ops::ElementwiseDoubleGradOpInplaceInferer, + ops::ElementwiseDoubleGradNoBufVarsInferer); REGISTER_OP_CPU_KERNEL( elementwise_sub, diff --git a/paddle/fluid/operators/fill_constant_batch_size_like_op.cc b/paddle/fluid/operators/fill_constant_batch_size_like_op.cc index ccd4a36287..f699dac797 100644 --- a/paddle/fluid/operators/fill_constant_batch_size_like_op.cc +++ b/paddle/fluid/operators/fill_constant_batch_size_like_op.cc @@ -63,7 +63,7 @@ REGISTER_OPERATOR( paddle::framework::EmptyGradOpMaker, paddle::framework::EmptyGradOpMaker, ops::FillConstantBatchSizeLikeOpMaker, - ops::BatchSizeLikeNoNeedBufferVarsInference); + ops::BatchSizeLikeNoNeedBufferVarsInferer); REGISTER_OP_CPU_KERNEL( fill_constant_batch_size_like, ops::FillConstantBatchSizeLikeOpKernel, paddle::framework::EmptyGradOpMaker); diff --git a/paddle/fluid/operators/flatten_op.cc b/paddle/fluid/operators/flatten_op.cc index 067e00f35b..aff5f49c73 100644 --- a/paddle/fluid/operators/flatten_op.cc +++ b/paddle/fluid/operators/flatten_op.cc @@ -241,11 +241,11 @@ class Flatten2GradOp : public framework::OperatorWithKernel { } }; -DECLARE_INPLACE_OP_INFERER(FlattenOpInplaceInToOut, {"X", "Out"}); -DECLARE_INPLACE_OP_INFERER(FlattenGradInplaceinToOut, +DECLARE_INPLACE_OP_INFERER(FlattenOpInplaceInferer, {"X", "Out"}); +DECLARE_INPLACE_OP_INFERER(FlattenGradInplaceInferer, {framework::GradVarName("Out"), framework::GradVarName("X")}); -DECLARE_NO_NEED_BUFFER_VARS_INFERER(FlattenGradNoNeedBufferVarsInference, "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(FlattenGradNoNeedBufferVarsInferer, "X"); } // namespace operators } // namespace paddle @@ -254,17 +254,17 @@ namespace ops = paddle::operators; REGISTER_OPERATOR(flatten, ops::FlattenOp, ops::FlattenOpMaker, ops::FlattenGradOpMaker, ops::FlattenGradOpMaker, - ops::FlattenOpInplaceInToOut); + ops::FlattenOpInplaceInferer); REGISTER_OPERATOR(flatten_grad, ops::FlattenGradOp, - ops::FlattenGradInplaceinToOut, - ops::FlattenGradNoNeedBufferVarsInference); + ops::FlattenGradInplaceInferer, + ops::FlattenGradNoNeedBufferVarsInferer); REGISTER_OPERATOR(flatten2, ops::Flatten2Op, ops::Flatten2OpMaker, ops::Flatten2GradOpMaker, ops::Flatten2GradOpMaker, - ops::FlattenOpInplaceInToOut); + ops::FlattenOpInplaceInferer); REGISTER_OPERATOR(flatten2_grad, ops::Flatten2GradOp, - ops::FlattenGradInplaceinToOut); + ops::FlattenGradInplaceInferer); REGISTER_OP_CPU_KERNEL( flatten, ops::FlattenKernel, diff --git a/paddle/fluid/operators/gather_nd_op.cc b/paddle/fluid/operators/gather_nd_op.cc index e058564b42..c22c8a18ca 100644 --- a/paddle/fluid/operators/gather_nd_op.cc +++ b/paddle/fluid/operators/gather_nd_op.cc @@ -166,7 +166,7 @@ class GatherNdGradOpMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(GatherNdGradNoNeedBufferVarInference, "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(GatherNdGradNoNeedBufferVarInferer, "X"); } // namespace operators } // namespace paddle @@ -178,7 +178,7 @@ REGISTER_OPERATOR(gather_nd, ops::GatherNdOp, ops::GatherNdOpMaker, ops::GatherNdGradOpMaker); REGISTER_OPERATOR(gather_nd_grad, ops::GatherNdGradOp, - ops::GatherNdGradNoNeedBufferVarInference); + ops::GatherNdGradNoNeedBufferVarInferer); REGISTER_OP_CPU_KERNEL(gather_nd, ops::GatherNdOpKernel, ops::GatherNdOpKernel, diff --git a/paddle/fluid/operators/gather_op.cc b/paddle/fluid/operators/gather_op.cc index e3cabb9861..6a3abaa600 100644 --- a/paddle/fluid/operators/gather_op.cc +++ b/paddle/fluid/operators/gather_op.cc @@ -127,7 +127,7 @@ class GatherGradOpMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(GatherGradNoNeedBufferVarInference, "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(GatherGradNoNeedBufferVarInferer, "X"); } // namespace operators } // namespace paddle @@ -137,7 +137,7 @@ REGISTER_OPERATOR(gather, ops::GatherOp, ops::GatherOpMaker, ops::GatherGradOpMaker, ops::GatherGradOpMaker); REGISTER_OPERATOR(gather_grad, ops::GatherGradOp, - ops::GatherGradNoNeedBufferVarInference); + ops::GatherGradNoNeedBufferVarInferer); REGISTER_OP_CPU_KERNEL(gather, ops::GatherOpKernel, ops::GatherOpKernel, ops::GatherOpKernel, ops::GatherOpKernel, diff --git a/paddle/fluid/operators/gaussian_random_batch_size_like_op.cc b/paddle/fluid/operators/gaussian_random_batch_size_like_op.cc index ab7403a8ba..d98721cfff 100644 --- a/paddle/fluid/operators/gaussian_random_batch_size_like_op.cc +++ b/paddle/fluid/operators/gaussian_random_batch_size_like_op.cc @@ -74,6 +74,6 @@ REGISTER_OPERATOR( paddle::operators::GaussianRandomBatchSizeLikeOpMaker, paddle::framework::EmptyGradOpMaker, paddle::framework::EmptyGradOpMaker, - paddle::operators::BatchSizeLikeNoNeedBufferVarsInference); + paddle::operators::BatchSizeLikeNoNeedBufferVarsInferer); // Kernels are registered in gaussian_random_op.cc and gaussian_random_op.cu diff --git a/paddle/fluid/operators/group_norm_op.cc b/paddle/fluid/operators/group_norm_op.cc index 793b607937..978170b296 100644 --- a/paddle/fluid/operators/group_norm_op.cc +++ b/paddle/fluid/operators/group_norm_op.cc @@ -216,8 +216,8 @@ class GroupNormGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_INPLACE_OP_INFERER(GroupNormInplaceInToOut, {"X", "Y"}); -DECLARE_INPLACE_OP_INFERER(GroupNormGradInplaceInToOut, +DECLARE_INPLACE_OP_INFERER(GroupNormInplaceInferer, {"X", "Y"}); +DECLARE_INPLACE_OP_INFERER(GroupNormGradInplaceInferer, {framework::GradVarName("Y"), framework::GradVarName("X")}); @@ -239,9 +239,9 @@ REGISTER_OPERATOR(group_norm, ops::GroupNormOp, ops::GroupNormOpMaker, ops::GroupNormOpInferVarType, ops::GroupNormGradMaker, ops::GroupNormGradMaker, - ops::GroupNormInplaceInToOut); + ops::GroupNormInplaceInferer); REGISTER_OPERATOR(group_norm_grad, ops::GroupNormGradOp, - ops::GroupNormGradInplaceInToOut); + ops::GroupNormGradInplaceInferer); REGISTER_OP_CPU_KERNEL( group_norm, ops::GroupNormKernel, ops::GroupNormKernel); diff --git a/paddle/fluid/operators/gru_op.cc b/paddle/fluid/operators/gru_op.cc index a9c3612d60..dc82e4fa75 100644 --- a/paddle/fluid/operators/gru_op.cc +++ b/paddle/fluid/operators/gru_op.cc @@ -456,7 +456,7 @@ class GRUGradOpMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(GRUGradOpNoNeedBufferVarInference, "Input", +DECLARE_NO_NEED_BUFFER_VARS_INFERER(GRUGradOpNoNeedBufferVarInferer, "Input", "Bias"); } // namespace operators @@ -467,7 +467,7 @@ REGISTER_OPERATOR(gru, ops::GRUOp, ops::GRUOpMaker, ops::GRUGradOpMaker, ops::GRUGradOpMaker); REGISTER_OPERATOR(gru_grad, ops::GRUGradOp, - ops::GRUGradOpNoNeedBufferVarInference); + ops::GRUGradOpNoNeedBufferVarInferer); REGISTER_OP_CPU_KERNEL(gru, ops::GRUCPUKernel, ops::GRUCPUKernel); REGISTER_OP_CPU_KERNEL( diff --git a/paddle/fluid/operators/gru_unit_op.cc b/paddle/fluid/operators/gru_unit_op.cc index c4225c9088..1edac8c2a1 100644 --- a/paddle/fluid/operators/gru_unit_op.cc +++ b/paddle/fluid/operators/gru_unit_op.cc @@ -234,7 +234,7 @@ class GRUUnitGradOpMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(GRUUnitGradOpNoNeedBufferVarInference, +DECLARE_NO_NEED_BUFFER_VARS_INFERER(GRUUnitGradOpNoNeedBufferVarInferer, "Bias"); } // namespace operators @@ -246,7 +246,7 @@ REGISTER_OPERATOR(gru_unit, ops::GRUUnitOp, ops::GRUUnitOpMaker, ops::GRUUnitGradOpMaker, ops::GRUUnitGradOpMaker); REGISTER_OPERATOR(gru_unit_grad, ops::GRUUnitGradOp, - ops::GRUUnitGradOpNoNeedBufferVarInference); + ops::GRUUnitGradOpNoNeedBufferVarInferer); REGISTER_OP_CPU_KERNEL( gru_unit, ops::GRUUnitKernel, diff --git a/paddle/fluid/operators/uniform_random_batch_size_like_op.cc b/paddle/fluid/operators/uniform_random_batch_size_like_op.cc index f90bb4be03..a9191c09ea 100644 --- a/paddle/fluid/operators/uniform_random_batch_size_like_op.cc +++ b/paddle/fluid/operators/uniform_random_batch_size_like_op.cc @@ -78,5 +78,5 @@ REGISTER_OPERATOR( paddle::operators::UniformRandomBatchSizeLikeOpMaker, paddle::framework::EmptyGradOpMaker, paddle::framework::EmptyGradOpMaker, - paddle::operators::BatchSizeLikeNoNeedBufferVarsInference); + paddle::operators::BatchSizeLikeNoNeedBufferVarsInferer); // Kernels are registered in uniform_random_op.cc and uniform_random_op.cu -- GitLab