From 53e6f8e1da67c015c7180f9ecbe1a5c2e49f6182 Mon Sep 17 00:00:00 2001 From: Zeng Jinle <32832641+sneaxiy@users.noreply.github.com> Date: Wed, 25 Mar 2020 10:38:29 -0500 Subject: [PATCH] rename macro, test=develop (#23161) --- paddle/fluid/framework/no_need_buffer_vars_inference.h | 5 +---- paddle/fluid/operators/pad2d_op.cc | 3 +-- paddle/fluid/operators/pool_with_index_op.cc | 2 +- paddle/fluid/operators/reshape_op.cc | 4 ++-- paddle/fluid/operators/roi_align_op.cc | 2 +- paddle/fluid/operators/scatter_nd_add_op.cc | 4 ++-- paddle/fluid/operators/scatter_op.cc | 4 ++-- paddle/fluid/operators/slice_op.cc | 4 ++-- paddle/fluid/operators/space_to_depth_op.cc | 2 +- paddle/fluid/operators/squared_l2_distance_op.cc | 3 +-- paddle/fluid/operators/squeeze_op.cc | 3 +-- paddle/fluid/operators/strided_slice_op.cc | 4 ++-- paddle/fluid/operators/unfold_op.cc | 3 +-- paddle/fluid/operators/unsqueeze_op.cc | 4 ++-- paddle/fluid/operators/warpctc_op.cc | 4 ++-- 15 files changed, 22 insertions(+), 29 deletions(-) diff --git a/paddle/fluid/framework/no_need_buffer_vars_inference.h b/paddle/fluid/framework/no_need_buffer_vars_inference.h index 8ceb922c668..ace2b237157 100644 --- a/paddle/fluid/framework/no_need_buffer_vars_inference.h +++ b/paddle/fluid/framework/no_need_buffer_vars_inference.h @@ -81,7 +81,7 @@ class NoNeedBufferVarsInference { } }; -#define DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(class_type, ...) \ +#define DECLARE_NO_NEED_BUFFER_VARS_INFERER(class_type, ...) \ class class_type final \ : public ::paddle::framework::NoNeedBufferVarsInference { \ public: \ @@ -96,9 +96,6 @@ class NoNeedBufferVarsInference { } \ } -#define DECLARE_NO_NEED_BUFFER_VARS_INFERER \ - DECLARE_NO_NEED_BUFFER_VARS_INFERENCE - class InferNoNeedBufferVarsFN { public: inline const std::unordered_set &operator()( diff --git a/paddle/fluid/operators/pad2d_op.cc b/paddle/fluid/operators/pad2d_op.cc index b41b1abec09..25a7be6dac4 100644 --- a/paddle/fluid/operators/pad2d_op.cc +++ b/paddle/fluid/operators/pad2d_op.cc @@ -646,8 +646,7 @@ class Pad2dOpGradMaker : public framework::SingleGradOpMaker { }; // TODO(zjl): Paddings can also be skipped! -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(Pad2dOpGradNoNeedBufferVarsInference, - "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(Pad2dOpGradNoNeedBufferVarsInference, "X"); } // namespace operators } // namespace paddle diff --git a/paddle/fluid/operators/pool_with_index_op.cc b/paddle/fluid/operators/pool_with_index_op.cc index 779da1468d9..116fb01f718 100644 --- a/paddle/fluid/operators/pool_with_index_op.cc +++ b/paddle/fluid/operators/pool_with_index_op.cc @@ -307,7 +307,7 @@ class MaxPoolWithIndexGradOpMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( +DECLARE_NO_NEED_BUFFER_VARS_INFERER( MaxPoolWithIndexOpGradNoNeedBufferVarsInference, "X"); } // namespace operators diff --git a/paddle/fluid/operators/reshape_op.cc b/paddle/fluid/operators/reshape_op.cc index b967ead55fe..9835da40d22 100644 --- a/paddle/fluid/operators/reshape_op.cc +++ b/paddle/fluid/operators/reshape_op.cc @@ -542,8 +542,8 @@ DECLARE_INPLACE_OP_INFERER(ReshapeGradInplaceInToOut, {framework::GradVarName("Out"), framework::GradVarName("X")}); DECLARE_INPLACE_OP_INFERER(ReshapeDoubleGradInplaceInToOut, {"DDX", "DDOut"}); -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( - ReshapeDoubleGradOpNoNeedBufferVarInference, "DOut"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(ReshapeDoubleGradOpNoNeedBufferVarInference, + "DOut"); } // namespace operators } // namespace paddle diff --git a/paddle/fluid/operators/roi_align_op.cc b/paddle/fluid/operators/roi_align_op.cc index 1f73175d9ee..a019cbd0b19 100644 --- a/paddle/fluid/operators/roi_align_op.cc +++ b/paddle/fluid/operators/roi_align_op.cc @@ -169,7 +169,7 @@ class ROIAlignGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(RoiAlignGradNoNeedBufVarsInferer, "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(RoiAlignGradNoNeedBufVarsInferer, "X"); } // namespace operators } // namespace paddle diff --git a/paddle/fluid/operators/scatter_nd_add_op.cc b/paddle/fluid/operators/scatter_nd_add_op.cc index 5f4fa3e53a5..ef8522c11d9 100644 --- a/paddle/fluid/operators/scatter_nd_add_op.cc +++ b/paddle/fluid/operators/scatter_nd_add_op.cc @@ -159,8 +159,8 @@ class ScatterNdAddGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(ScatterNdAddGradNoNeedBufferVarsInference, - "Updates"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(ScatterNdAddGradNoNeedBufferVarsInference, + "Updates"); } // namespace operators } // namespace paddle diff --git a/paddle/fluid/operators/scatter_op.cc b/paddle/fluid/operators/scatter_op.cc index 79ee7a41c14..72890c5bf13 100644 --- a/paddle/fluid/operators/scatter_op.cc +++ b/paddle/fluid/operators/scatter_op.cc @@ -125,8 +125,8 @@ class ScatterGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(ScatterGradNoNeedBufferVarsInference, - "Updates"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(ScatterGradNoNeedBufferVarsInference, + "Updates"); DECLARE_INPLACE_OP_INFERER(ScatterInplaceInferer, {"X", "Out"}); DECLARE_INPLACE_OP_INFERER(ScatterGradInplaceInferer, diff --git a/paddle/fluid/operators/slice_op.cc b/paddle/fluid/operators/slice_op.cc index 303c41378b1..61ab2bb87fc 100644 --- a/paddle/fluid/operators/slice_op.cc +++ b/paddle/fluid/operators/slice_op.cc @@ -315,8 +315,8 @@ class SliceDoubleOpGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(SliceOpGradNoNeedBufferVarsInference, - "Input"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(SliceOpGradNoNeedBufferVarsInference, + "Input"); } // namespace operators } // namespace paddle diff --git a/paddle/fluid/operators/space_to_depth_op.cc b/paddle/fluid/operators/space_to_depth_op.cc index 1925efba197..fe251a43045 100644 --- a/paddle/fluid/operators/space_to_depth_op.cc +++ b/paddle/fluid/operators/space_to_depth_op.cc @@ -131,7 +131,7 @@ class SpaceToDepthOpMaker : public framework::OpProtoAndCheckerMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(SpaceToDepthGradOpNoBuffer, "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(SpaceToDepthGradOpNoBuffer, "X"); template class SpaceToDepthGradOpMaker : public framework::SingleGradOpMaker { diff --git a/paddle/fluid/operators/squared_l2_distance_op.cc b/paddle/fluid/operators/squared_l2_distance_op.cc index db71a4d7226..8288d136973 100644 --- a/paddle/fluid/operators/squared_l2_distance_op.cc +++ b/paddle/fluid/operators/squared_l2_distance_op.cc @@ -71,8 +71,7 @@ class SquaredL2DistanceOp : public framework::OperatorWithKernel { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(SquaredL2DistanceGradOpNoBuffer, "X", - "Y"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(SquaredL2DistanceGradOpNoBuffer, "X", "Y"); template class SquaredL2DistanceGradOpMaker : public framework::SingleGradOpMaker { diff --git a/paddle/fluid/operators/squeeze_op.cc b/paddle/fluid/operators/squeeze_op.cc index 2698be4bc51..758f6e1f884 100644 --- a/paddle/fluid/operators/squeeze_op.cc +++ b/paddle/fluid/operators/squeeze_op.cc @@ -286,8 +286,7 @@ DECLARE_INPLACE_OP_INFERER(SequeezeInplaceInferer, {"X", "Out"}); DECLARE_INPLACE_OP_INFERER(SequeezeGradInplaceInferer, {framework::GradVarName("Out"), framework::GradVarName("X")}); -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(SqueezeGradNoNeedBufferVarsInference, - "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(SqueezeGradNoNeedBufferVarsInference, "X"); } // namespace operators } // namespace paddle diff --git a/paddle/fluid/operators/strided_slice_op.cc b/paddle/fluid/operators/strided_slice_op.cc index 4ff5207ddd0..a0d6072af1b 100644 --- a/paddle/fluid/operators/strided_slice_op.cc +++ b/paddle/fluid/operators/strided_slice_op.cc @@ -272,8 +272,8 @@ class StridedSliceOpGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( - StridedSliceOpGradNoNeedBufferVarsInference, "Input"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(StridedSliceOpGradNoNeedBufferVarsInference, + "Input"); } // namespace operators } // namespace paddle diff --git a/paddle/fluid/operators/unfold_op.cc b/paddle/fluid/operators/unfold_op.cc index 77167804edf..6500eda6386 100644 --- a/paddle/fluid/operators/unfold_op.cc +++ b/paddle/fluid/operators/unfold_op.cc @@ -163,8 +163,7 @@ class UnfoldGradMaker : public framework::SingleGradOpMaker { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(UnfoldGradOpNoNeedBufferVarsInference, - "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(UnfoldGradOpNoNeedBufferVarsInference, "X"); } // namespace operators } // namespace paddle diff --git a/paddle/fluid/operators/unsqueeze_op.cc b/paddle/fluid/operators/unsqueeze_op.cc index 4c092396b2d..c12f59ce923 100644 --- a/paddle/fluid/operators/unsqueeze_op.cc +++ b/paddle/fluid/operators/unsqueeze_op.cc @@ -282,8 +282,8 @@ DECLARE_INPLACE_OP_INFERER(UnsqueezeInplaceInferer, {"X", "Out"}); DECLARE_INPLACE_OP_INFERER(UnsqueezeGradInplaceInferer, {framework::GradVarName("Out"), framework::GradVarName("X")}); -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(UnsqueezeGradOpNoNeedBufferVarInference, - "X"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(UnsqueezeGradOpNoNeedBufferVarInference, + "X"); } // namespace operators } // namespace paddle diff --git a/paddle/fluid/operators/warpctc_op.cc b/paddle/fluid/operators/warpctc_op.cc index ea37b698260..7ec0aa0e296 100644 --- a/paddle/fluid/operators/warpctc_op.cc +++ b/paddle/fluid/operators/warpctc_op.cc @@ -178,8 +178,8 @@ class WarpCTCGradOp : public framework::OperatorWithKernel { } }; -DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(WarpCTCGradOpNoNeedBufferVarInference, - "Logits"); +DECLARE_NO_NEED_BUFFER_VARS_INFERER(WarpCTCGradOpNoNeedBufferVarInference, + "Logits"); } // namespace operators } // namespace paddle -- GitLab