From de8b4f42cf0f48c17f8a41b4faa22efd8624ab8a Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Mon, 25 May 2020 20:01:35 +0800 Subject: [PATCH] rename inplace/no_need_buffer inferer, part 1, test=develop (#24711) --- .../operators/hierarchical_sigmoid_op.cc | 4 ++-- paddle/fluid/operators/index_select_op.cc | 4 ++-- paddle/fluid/operators/instance_norm_op.cc | 4 ++-- paddle/fluid/operators/interpolate_op.cc | 12 +++++------ paddle/fluid/operators/kldiv_loss_op.cc | 4 ++-- paddle/fluid/operators/layer_norm_op.cc | 4 ++-- paddle/fluid/operators/linear_chain_crf_op.cc | 4 ++-- paddle/fluid/operators/lod_reset_op.cc | 4 ++-- paddle/fluid/operators/lookup_table_op.cc | 4 ++-- paddle/fluid/operators/lookup_table_v2_op.cc | 5 +++-- paddle/fluid/operators/mean_op.cc | 4 ++-- paddle/fluid/operators/nce_op.cc | 4 ++-- paddle/fluid/operators/pad2d_op.cc | 4 ++-- paddle/fluid/operators/pool_with_index_op.cc | 6 +++--- paddle/fluid/operators/push_dense_op.cc | 4 ++-- paddle/fluid/operators/reshape_op.cc | 20 +++++++++---------- paddle/fluid/operators/scale_op.cc | 4 ++-- .../softmax_with_cross_entropy_op.cc | 8 ++++---- paddle/fluid/operators/sum_op.cc | 4 ++-- 19 files changed, 54 insertions(+), 53 deletions(-) diff --git a/paddle/fluid/operators/hierarchical_sigmoid_op.cc b/paddle/fluid/operators/hierarchical_sigmoid_op.cc index dd72a212d36..05d521be5a1 100644 --- a/paddle/fluid/operators/hierarchical_sigmoid_op.cc +++ b/paddle/fluid/operators/hierarchical_sigmoid_op.cc @@ -257,7 +257,7 @@ class HierarchicalSigmoidGradOpGradVarTypeInference }; DECLARE_NO_NEED_BUFFER_VARS_INFERER( - HierarchicalSigmoidGradOpNoNeedBufferVarInference, "Bias"); + HierarchicalSigmoidGradOpNoNeedBufferVarInferer, "Bias"); } // namespace operators } // namespace paddle @@ -270,7 +270,7 @@ REGISTER_OPERATOR( ops::HierarchicalSigmoidGradMaker); REGISTER_OPERATOR(hierarchical_sigmoid_grad, ops::HierarchicalSigmoidGradOp, ops::HierarchicalSigmoidGradOpGradVarTypeInference, - ops::HierarchicalSigmoidGradOpNoNeedBufferVarInference); + ops::HierarchicalSigmoidGradOpNoNeedBufferVarInferer); REGISTER_OP_CPU_KERNEL( hierarchical_sigmoid, ops::HierarchicalSigmoidOpKernel, diff --git a/paddle/fluid/operators/index_select_op.cc b/paddle/fluid/operators/index_select_op.cc index 31ef7b7662b..60ca7e2fe7c 100644 --- a/paddle/fluid/operators/index_select_op.cc +++ b/paddle/fluid/operators/index_select_op.cc @@ -138,7 +138,7 @@ class IndexSelectGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(IndexSelectGradNoNeedBufferVarsInference, +DECLARE_NO_NEED_BUFFER_VARS_INFERER(IndexSelectGradNoNeedBufferVarsInferer, "X"); } // namespace operators } // namespace paddle @@ -148,7 +148,7 @@ REGISTER_OPERATOR(index_select, ops::IndexSelectOp, ops::IndexSelectOpMaker, ops::IndexSelectGradMaker, ops::IndexSelectGradMaker); REGISTER_OPERATOR(index_select_grad, ops::IndexSelectGradOp, - ops::IndexSelectGradNoNeedBufferVarsInference); + ops::IndexSelectGradNoNeedBufferVarsInferer); REGISTER_OP_CPU_KERNEL( index_select, ops::IndexSelectKernel, diff --git a/paddle/fluid/operators/instance_norm_op.cc b/paddle/fluid/operators/instance_norm_op.cc index 2609d243705..a915c018ab9 100644 --- a/paddle/fluid/operators/instance_norm_op.cc +++ b/paddle/fluid/operators/instance_norm_op.cc @@ -603,7 +603,7 @@ class InstanceNormDoubleGradKernel } }; -DECLARE_INPLACE_OP_INFERER(InstanceNormDoubleGradOpInplaceInference, +DECLARE_INPLACE_OP_INFERER(InstanceNormDoubleGradOpInplaceInferer, {"DY", "DDY"}); } // namespace operators @@ -618,7 +618,7 @@ REGISTER_OPERATOR(instance_norm_grad, ops::InstanceNormGradOp, ops::InstanceNormDoubleGradMaker, ops::InstanceNormDoubleGradMaker); REGISTER_OPERATOR(instance_norm_grad_grad, ops::InstanceNormDoubleGradOp, - ops::InstanceNormDoubleGradOpInplaceInference); + ops::InstanceNormDoubleGradOpInplaceInferer); REGISTER_OP_CPU_KERNEL( instance_norm, diff --git a/paddle/fluid/operators/interpolate_op.cc b/paddle/fluid/operators/interpolate_op.cc index 49da719880d..1e99e22e12b 100644 --- a/paddle/fluid/operators/interpolate_op.cc +++ b/paddle/fluid/operators/interpolate_op.cc @@ -585,7 +585,7 @@ class InterpolateGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(InterpolateGradNoNeedBufferVarsInference, +DECLARE_NO_NEED_BUFFER_VARS_INFERER(InterpolateGradNoNeedBufferVarsInferer, "X"); } // namespace operators @@ -596,22 +596,22 @@ REGISTER_OPERATOR(bilinear_interp, ops::InterpolateOp, ops::InterpolateOpMaker, ops::InterpolateGradMaker, ops::InterpolateGradMaker); REGISTER_OPERATOR(bilinear_interp_grad, ops::InterpolateOpGrad, - ops::InterpolateGradNoNeedBufferVarsInference); + ops::InterpolateGradNoNeedBufferVarsInferer); REGISTER_OPERATOR(nearest_interp, ops::InterpolateOp, ops::InterpolateOpMaker, ops::InterpolateGradMaker, ops::InterpolateGradMaker); REGISTER_OPERATOR(nearest_interp_grad, ops::InterpolateOpGrad, - ops::InterpolateGradNoNeedBufferVarsInference); + ops::InterpolateGradNoNeedBufferVarsInferer); REGISTER_OPERATOR(trilinear_interp, ops::InterpolateOp, ops::InterpolateOpMaker, ops::InterpolateGradMaker, ops::InterpolateGradMaker); REGISTER_OPERATOR(trilinear_interp_grad, ops::InterpolateOpGrad, - ops::InterpolateGradNoNeedBufferVarsInference); + ops::InterpolateGradNoNeedBufferVarsInferer); REGISTER_OPERATOR(bicubic_interp, ops::InterpolateOp, ops::InterpolateOpMaker, ops::InterpolateGradMaker, ops::InterpolateGradMaker); REGISTER_OPERATOR(bicubic_interp_grad, ops::InterpolateOpGrad, - ops::InterpolateGradNoNeedBufferVarsInference); + ops::InterpolateGradNoNeedBufferVarsInferer); REGISTER_OP_CPU_KERNEL(bilinear_interp, ops::InterpolateKernel, ops::InterpolateKernel, ops::InterpolateKernel); @@ -631,7 +631,7 @@ REGISTER_OPERATOR(linear_interp, ops::InterpolateOp, ops::InterpolateOpMaker, ops::InterpolateGradMaker, ops::InterpolateGradMaker); REGISTER_OPERATOR(linear_interp_grad, ops::InterpolateOpGrad, - ops::InterpolateGradNoNeedBufferVarsInference); + ops::InterpolateGradNoNeedBufferVarsInferer); REGISTER_OP_CPU_KERNEL(linear_interp, ops::InterpolateKernel, ops::InterpolateKernel, ops::InterpolateKernel); diff --git a/paddle/fluid/operators/kldiv_loss_op.cc b/paddle/fluid/operators/kldiv_loss_op.cc index 7286e2e6d31..a78d8ec1014 100644 --- a/paddle/fluid/operators/kldiv_loss_op.cc +++ b/paddle/fluid/operators/kldiv_loss_op.cc @@ -166,7 +166,7 @@ class KLDivLossOpGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(KLDivLossGradNoNeedBufferVarInference, "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(KLDivLossGradNoNeedBufferVarInferer, "X"); } // namespace operators } // namespace paddle @@ -176,7 +176,7 @@ REGISTER_OPERATOR(kldiv_loss, ops::KLDivLossOp, ops::KLDivLossOpMaker, ops::KLDivLossOpGradMaker, ops::KLDivLossOpGradMaker); REGISTER_OPERATOR(kldiv_loss_grad, ops::KLDivLossOpGrad, - ops::KLDivLossGradNoNeedBufferVarInference); + ops::KLDivLossGradNoNeedBufferVarInferer); REGISTER_OP_CPU_KERNEL( kldiv_loss, ops::KLDivLossKernel, ops::KLDivLossKernel); diff --git a/paddle/fluid/operators/layer_norm_op.cc b/paddle/fluid/operators/layer_norm_op.cc index 3c308ecd510..89d8b57505d 100644 --- a/paddle/fluid/operators/layer_norm_op.cc +++ b/paddle/fluid/operators/layer_norm_op.cc @@ -220,7 +220,7 @@ class LayerNormGradOpMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(LayerNormGradNoNeedBufferVarInference, +DECLARE_NO_NEED_BUFFER_VARS_INFERER(LayerNormGradNoNeedBufferVarInferer, "Bias"); } // namespace operators @@ -231,7 +231,7 @@ REGISTER_OPERATOR(layer_norm, ops::LayerNormOp, ops::LayerNormOpMaker, ops::LayerNormGradOpMaker, ops::LayerNormGradOpMaker); REGISTER_OPERATOR(layer_norm_grad, ops::LayerNormGradOp, - ops::LayerNormGradNoNeedBufferVarInference); + ops::LayerNormGradNoNeedBufferVarInferer); REGISTER_OP_CPU_KERNEL( layer_norm, ops::LayerNormKernel, ops::LayerNormKernel); diff --git a/paddle/fluid/operators/linear_chain_crf_op.cc b/paddle/fluid/operators/linear_chain_crf_op.cc index 72eb7fb21d1..f2ccbb2f21a 100644 --- a/paddle/fluid/operators/linear_chain_crf_op.cc +++ b/paddle/fluid/operators/linear_chain_crf_op.cc @@ -345,7 +345,7 @@ class LinearChainCRFGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(LinearChainCRFGradNoNeedBufferVarsInference, +DECLARE_NO_NEED_BUFFER_VARS_INFERER(LinearChainCRFGradNoNeedBufferVarsInferer, "Transition", "Emission"); } // namespace operators @@ -357,7 +357,7 @@ REGISTER_OPERATOR(linear_chain_crf, ops::LinearChainCRFOp, ops::LinearChainCRFGradMaker, ops::LinearChainCRFGradMaker); REGISTER_OPERATOR(linear_chain_crf_grad, ops::LinearChainCRFGradOp, - ops::LinearChainCRFGradNoNeedBufferVarsInference); + ops::LinearChainCRFGradNoNeedBufferVarsInferer); REGISTER_OP_CPU_KERNEL( linear_chain_crf, ops::LinearChainCRFOpKernel, diff --git a/paddle/fluid/operators/lod_reset_op.cc b/paddle/fluid/operators/lod_reset_op.cc index 377ecacabc1..56163096833 100644 --- a/paddle/fluid/operators/lod_reset_op.cc +++ b/paddle/fluid/operators/lod_reset_op.cc @@ -223,7 +223,7 @@ DECLARE_INPLACE_OP_INFERER(LoDResetGradInplaceInferer, {framework::GradVarName("Out"), framework::GradVarName("X")}); -DECLARE_NO_NEED_BUFFER_VARS_INFERER(LoDResetGradNoNeedBufferVarInference, "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(LoDResetGradNoNeedBufferVarInferer, "X"); } // namespace operators } // namespace paddle @@ -234,7 +234,7 @@ REGISTER_OPERATOR(lod_reset, ops::LoDResetOp, ops::LoDResetOpMaker, ops::LoDResetGradMaker, ops::LoDResetOpVarTypeInference, ops::LoDResetInplaceInferer); REGISTER_OPERATOR(lod_reset_grad, ops::LoDResetGradOp, - ops::LoDResetGradNoNeedBufferVarInference, + ops::LoDResetGradNoNeedBufferVarInferer, ops::LoDResetGradInplaceInferer); REGISTER_OP_CPU_KERNEL( diff --git a/paddle/fluid/operators/lookup_table_op.cc b/paddle/fluid/operators/lookup_table_op.cc index 158080cf8a3..9b1519b5469 100644 --- a/paddle/fluid/operators/lookup_table_op.cc +++ b/paddle/fluid/operators/lookup_table_op.cc @@ -130,7 +130,7 @@ or not. And the output only shares the LoD information with input Ids. } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(LookupTableGradOpNoBuffer, "W"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(LookupTableGradOpNoBufferVarsInferer, "W"); template class LookupTableGradOpMaker : public framework::SingleGradOpMaker { @@ -198,7 +198,7 @@ REGISTER_OPERATOR(lookup_table, ops::LookupTableOp, ops::LookupTableOpMaker, ops::LookupTableGradOpMaker); REGISTER_OPERATOR(lookup_table_grad, ops::LookupTableOpGrad, - ops::LookupTableGradOpNoBuffer, + ops::LookupTableGradOpNoBufferVarsInferer, ops::LookupTableOpGradVarTypeInference); REGISTER_OP_CPU_KERNEL(lookup_table, ops::LookupTableKernel, diff --git a/paddle/fluid/operators/lookup_table_v2_op.cc b/paddle/fluid/operators/lookup_table_v2_op.cc index 53c9e70dc7f..122e01f146c 100644 --- a/paddle/fluid/operators/lookup_table_v2_op.cc +++ b/paddle/fluid/operators/lookup_table_v2_op.cc @@ -118,7 +118,8 @@ or not. And the output only shares the LoD information with input Ids. } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(LookupTableV2GradOpNoBuffer, "W"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(LookupTableV2GradOpNoBufferVarsInferer, + "W"); template class LookupTableV2GradOpMaker : public framework::SingleGradOpMaker { @@ -187,7 +188,7 @@ REGISTER_OPERATOR(lookup_table_v2, ops::LookupTableV2Op, ops::LookupTableV2GradOpMaker); REGISTER_OPERATOR(lookup_table_v2_grad, ops::LookupTableV2OpGrad, - ops::LookupTableV2GradOpNoBuffer, + ops::LookupTableV2GradOpNoBufferVarsInferer, ops::LookupTableV2OpGradVarTypeInference); REGISTER_OP_CPU_KERNEL(lookup_table_v2, ops::LookupTableV2Kernel, diff --git a/paddle/fluid/operators/mean_op.cc b/paddle/fluid/operators/mean_op.cc index 7e75905bc49..764529a15b6 100644 --- a/paddle/fluid/operators/mean_op.cc +++ b/paddle/fluid/operators/mean_op.cc @@ -83,7 +83,7 @@ class MeanGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(MeanGradNoNeedBufferVarsInference, "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(MeanGradNoNeedBufferVarsInferer, "X"); } // namespace operators } // namespace paddle @@ -93,7 +93,7 @@ REGISTER_OPERATOR(mean, ops::MeanOp, ops::MeanOpMaker, ops::MeanOpInferVarType, ops::MeanGradMaker, ops::MeanGradMaker); REGISTER_OPERATOR(mean_grad, ops::MeanGradOp, - ops::MeanGradNoNeedBufferVarsInference); + ops::MeanGradNoNeedBufferVarsInferer); REGISTER_OP_CPU_KERNEL( mean, ops::MeanKernel, ops::MeanKernel); diff --git a/paddle/fluid/operators/nce_op.cc b/paddle/fluid/operators/nce_op.cc index 10ed364e37e..ce382389aa0 100644 --- a/paddle/fluid/operators/nce_op.cc +++ b/paddle/fluid/operators/nce_op.cc @@ -307,7 +307,7 @@ class NCEOpGradVarTypeInference : public framework::VarTypeInference { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(NCEGradOpNoNeedBufferVarInference, "Bias"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(NCEGradOpNoNeedBufferVarInferer, "Bias"); } // namespace operators } // namespace paddle @@ -317,7 +317,7 @@ REGISTER_OPERATOR(nce, ops::NCEOp, ops::NCEOpMaker, ops::NCEGradOpMaker, ops::NCEGradOpMaker); REGISTER_OPERATOR(nce_grad, ops::NCEOpGrad, ops::NCEOpGradVarTypeInference, - ops::NCEGradOpNoNeedBufferVarInference); + ops::NCEGradOpNoNeedBufferVarInferer); REGISTER_OP_CPU_KERNEL(nce, ops::NCEKernel, ops::NCEKernel); REGISTER_OP_CPU_KERNEL(nce_grad, diff --git a/paddle/fluid/operators/pad2d_op.cc b/paddle/fluid/operators/pad2d_op.cc index df3bb9c0101..e50af02dcc4 100644 --- a/paddle/fluid/operators/pad2d_op.cc +++ b/paddle/fluid/operators/pad2d_op.cc @@ -656,7 +656,7 @@ class Pad2dOpGradMaker : public framework::SingleGradOpMaker { }; // TODO(zjl): Paddings can also be skipped! -DECLARE_NO_NEED_BUFFER_VARS_INFERER(Pad2dOpGradNoNeedBufferVarsInference, "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(Pad2dOpGradNoNeedBufferVarsInferer, "X"); } // namespace operators } // namespace paddle @@ -667,7 +667,7 @@ REGISTER_OPERATOR(pad2d, ops::Pad2dOp, ops::Pad2dOpMaker, ops::Pad2dOpGradMaker, ops::Pad2dOpGradMaker); REGISTER_OPERATOR(pad2d_grad, ops::Pad2dOpGrad, - ops::Pad2dOpGradNoNeedBufferVarsInference); + ops::Pad2dOpGradNoNeedBufferVarsInferer); REGISTER_OP_CPU_KERNEL(pad2d, ops::Pad2dCPUKernel, ops::Pad2dCPUKernel, ops::Pad2dCPUKernel, ops::Pad2dCPUKernel); diff --git a/paddle/fluid/operators/pool_with_index_op.cc b/paddle/fluid/operators/pool_with_index_op.cc index d081ecb3a2b..0371ea5b09b 100644 --- a/paddle/fluid/operators/pool_with_index_op.cc +++ b/paddle/fluid/operators/pool_with_index_op.cc @@ -316,7 +316,7 @@ class MaxPoolWithIndexGradOpMaker : public framework::SingleGradOpMaker { }; DECLARE_NO_NEED_BUFFER_VARS_INFERER( - MaxPoolWithIndexOpGradNoNeedBufferVarsInference, "X"); + MaxPoolWithIndexOpGradNoNeedBufferVarsInferer, "X"); } // namespace operators } // namespace paddle @@ -328,7 +328,7 @@ REGISTER_OPERATOR(max_pool2d_with_index, ops::MaxPoolWithIndexOp, ops::MaxPoolWithIndexGradOpMaker, ops::MaxPoolWithIndexGradOpMaker); REGISTER_OPERATOR(max_pool2d_with_index_grad, ops::MaxPoolWithIndexOpGrad, - ops::MaxPoolWithIndexOpGradNoNeedBufferVarsInference); + ops::MaxPoolWithIndexOpGradNoNeedBufferVarsInferer); REGISTER_OP_CPU_KERNEL( max_pool2d_with_index, @@ -347,7 +347,7 @@ REGISTER_OPERATOR(max_pool3d_with_index, ops::MaxPoolWithIndexOp, ops::MaxPoolWithIndexGradOpMaker, ops::MaxPoolWithIndexGradOpMaker); REGISTER_OPERATOR(max_pool3d_with_index_grad, ops::MaxPoolWithIndexOpGrad, - ops::MaxPoolWithIndexOpGradNoNeedBufferVarsInference); + ops::MaxPoolWithIndexOpGradNoNeedBufferVarsInferer); REGISTER_OP_CPU_KERNEL( max_pool3d_with_index, diff --git a/paddle/fluid/operators/push_dense_op.cc b/paddle/fluid/operators/push_dense_op.cc index 20af4dba0da..5b9f05bd126 100644 --- a/paddle/fluid/operators/push_dense_op.cc +++ b/paddle/fluid/operators/push_dense_op.cc @@ -56,7 +56,7 @@ The input gradients is all dense gradient tensors in a table. } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERER(PushDenseNoNeedBufferVarsInference, "Ids"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(PushDenseNoNeedBufferVarsInferer, "Ids"); } // namespace operators } // namespace paddle @@ -66,5 +66,5 @@ REGISTER_OPERATOR( push_dense, ops::PushDenseOp, ops::PushDenseOpMaker, paddle::framework::EmptyGradOpMaker, paddle::framework::EmptyGradOpMaker, - ops::PushDenseNoNeedBufferVarsInference); + ops::PushDenseNoNeedBufferVarsInferer); REGISTER_OP_CPU_KERNEL(push_dense, ops::PushDenseCPUKernel) diff --git a/paddle/fluid/operators/reshape_op.cc b/paddle/fluid/operators/reshape_op.cc index 8eba5b888ec..fee0f045825 100644 --- a/paddle/fluid/operators/reshape_op.cc +++ b/paddle/fluid/operators/reshape_op.cc @@ -545,12 +545,12 @@ class Reshape2DoubleGradOp : public framework::OperatorWithKernel { } }; -DECLARE_INPLACE_OP_INFERER(ReshapeOpInplaceInToOut, {"X", "Out"}); -DECLARE_INPLACE_OP_INFERER(ReshapeGradInplaceInToOut, +DECLARE_INPLACE_OP_INFERER(ReshapeOpInplaceInferer, {"X", "Out"}); +DECLARE_INPLACE_OP_INFERER(ReshapeGradInplaceInferer, {framework::GradVarName("Out"), framework::GradVarName("X")}); -DECLARE_INPLACE_OP_INFERER(ReshapeDoubleGradInplaceInToOut, {"DDX", "DDOut"}); -DECLARE_NO_NEED_BUFFER_VARS_INFERER(ReshapeDoubleGradOpNoNeedBufferVarInference, +DECLARE_INPLACE_OP_INFERER(ReshapeDoubleGradInplaceInferer, {"DDX", "DDOut"}); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(ReshapeDoubleGradOpNoNeedBufferVarInferer, "DOut"); } // namespace operators @@ -562,9 +562,9 @@ REGISTER_OPERATOR( reshape, ops::ReshapeOp, ops::ReshapeOpMaker, paddle::framework::DefaultGradOpMaker, paddle::framework::DefaultGradOpMaker, - ops::ReshapeOpInplaceInToOut); + ops::ReshapeOpInplaceInferer); REGISTER_OPERATOR(reshape_grad, ops::ReshapeGradOp, - ops::ReshapeGradInplaceInToOut); + ops::ReshapeGradInplaceInferer); REGISTER_OP_CPU_KERNEL_FUNCTOR(reshape, float, ops::ReshapeKernel, double, ops::ReshapeKernel, int, ops::ReshapeKernel, @@ -576,14 +576,14 @@ REGISTER_OP_CPU_KERNEL_FUNCTOR(reshape_grad, float, ops::ReshapeGradKernel, REGISTER_OPERATOR(reshape2, ops::Reshape2Op, ops::Reshape2OpMaker, ops::Reshape2GradMaker, ops::Reshape2GradMaker, - ops::ReshapeOpInplaceInToOut); + ops::ReshapeOpInplaceInferer); REGISTER_OPERATOR(reshape2_grad, ops::Reshape2GradOp, ops::Reshape2DoubleGradMaker, ops::Reshape2DoubleGradMaker, - ops::ReshapeGradInplaceInToOut); + ops::ReshapeGradInplaceInferer); REGISTER_OPERATOR(reshape2_grad_grad, ops::Reshape2DoubleGradOp, - ops::ReshapeDoubleGradInplaceInToOut, - ops::ReshapeDoubleGradOpNoNeedBufferVarInference); + ops::ReshapeDoubleGradInplaceInferer, + ops::ReshapeDoubleGradOpNoNeedBufferVarInferer); REGISTER_OP_CPU_KERNEL_FUNCTOR(reshape2, float, ops::ReshapeKernel, double, ops::ReshapeKernel, int8_t, ops::ReshapeKernel, diff --git a/paddle/fluid/operators/scale_op.cc b/paddle/fluid/operators/scale_op.cc index 647e3cea99d..9d51f3e292f 100644 --- a/paddle/fluid/operators/scale_op.cc +++ b/paddle/fluid/operators/scale_op.cc @@ -104,7 +104,7 @@ class ScaleGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_INPLACE_OP_INFERER(ScaleOpInplace, {"X", "Out"}); +DECLARE_INPLACE_OP_INFERER(ScaleOpInplaceInferer, {"X", "Out"}); } // namespace operators } // namespace paddle @@ -113,7 +113,7 @@ namespace ops = paddle::operators; REGISTER_OPERATOR(scale, ops::ScaleOp, ops::ScaleOpMaker, ops::ScaleGradMaker, ops::ScaleGradMaker, - ops::ScaleOpVarTypeInference, ops::ScaleOpInplace); + ops::ScaleOpVarTypeInference, ops::ScaleOpInplaceInferer); REGISTER_OP_CPU_KERNEL( scale, ops::ScaleKernel, ops::ScaleKernel, diff --git a/paddle/fluid/operators/softmax_with_cross_entropy_op.cc b/paddle/fluid/operators/softmax_with_cross_entropy_op.cc index b5b99d3a929..946ede475ce 100644 --- a/paddle/fluid/operators/softmax_with_cross_entropy_op.cc +++ b/paddle/fluid/operators/softmax_with_cross_entropy_op.cc @@ -287,10 +287,10 @@ class SoftmaxGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_INPLACE_OP_INFERER(SoftmaxWithCrossEntropyInplaceInference, +DECLARE_INPLACE_OP_INFERER(SoftmaxWithCrossEntropyInplaceInferer, {"Logits", "Softmax"}); -DECLARE_INPLACE_OP_INFERER(SoftmaxWithCrossEntropyGradInplaceInference, +DECLARE_INPLACE_OP_INFERER(SoftmaxWithCrossEntropyGradInplaceInferer, {"Softmax", framework::GradVarName("Logits")}); } // namespace operators @@ -302,10 +302,10 @@ REGISTER_OPERATOR(softmax_with_cross_entropy, ops::SoftmaxWithCrossEntropyOp, ops::SoftmaxWithCrossEntropyOpMaker, ops::SoftmaxGradMaker, ops::SoftmaxGradMaker, - ops::SoftmaxWithCrossEntropyInplaceInference); + ops::SoftmaxWithCrossEntropyInplaceInferer); REGISTER_OPERATOR(softmax_with_cross_entropy_grad, ops::SoftmaxWithCrossEntropyOpGrad, - ops::SoftmaxWithCrossEntropyGradInplaceInference); + ops::SoftmaxWithCrossEntropyGradInplaceInferer); REGISTER_OP_CPU_KERNEL(softmax_with_cross_entropy, ops::SoftmaxWithCrossEntropyKernel, ops::SoftmaxWithCrossEntropyKernel); diff --git a/paddle/fluid/operators/sum_op.cc b/paddle/fluid/operators/sum_op.cc index 39d6a992043..b06e8202cc7 100644 --- a/paddle/fluid/operators/sum_op.cc +++ b/paddle/fluid/operators/sum_op.cc @@ -299,7 +299,7 @@ class SumGradOpBaseMaker : public imperative::GradOpBaseMakerBase { } }; -DECLARE_INPLACE_OP_INFERER(SumInplace, {"X", "Out"}); +DECLARE_INPLACE_OP_INFERER(SumInplaceInferer, {"X", "Out"}); } // namespace operators } // namespace paddle @@ -308,7 +308,7 @@ namespace ops = paddle::operators; REGISTER_OPERATOR(sum, ops::SumOp, ops::SumOpMaker, ops::SumGradDescMaker, ops::SumGradOpBaseMaker, ops::SumOpVarTypeInference, - ops::SumInplace); + ops::SumInplaceInferer); REGISTER_OP_CPU_KERNEL( sum, ops::SumKernel, -- GitLab