未验证 提交 53e6f8e1 编写于 作者: Z Zeng Jinle 提交者: GitHub

rename macro, test=develop (#23161)

上级 bba74071
...@@ -81,7 +81,7 @@ class NoNeedBufferVarsInference { ...@@ -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 \ class class_type final \
: public ::paddle::framework::NoNeedBufferVarsInference { \ : public ::paddle::framework::NoNeedBufferVarsInference { \
public: \ public: \
...@@ -96,9 +96,6 @@ class NoNeedBufferVarsInference { ...@@ -96,9 +96,6 @@ class NoNeedBufferVarsInference {
} \ } \
} }
#define DECLARE_NO_NEED_BUFFER_VARS_INFERER \
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE
class InferNoNeedBufferVarsFN { class InferNoNeedBufferVarsFN {
public: public:
inline const std::unordered_set<std::string> &operator()( inline const std::unordered_set<std::string> &operator()(
......
...@@ -646,8 +646,7 @@ class Pad2dOpGradMaker : public framework::SingleGradOpMaker<T> { ...@@ -646,8 +646,7 @@ class Pad2dOpGradMaker : public framework::SingleGradOpMaker<T> {
}; };
// TODO(zjl): Paddings can also be skipped! // TODO(zjl): Paddings can also be skipped!
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(Pad2dOpGradNoNeedBufferVarsInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(Pad2dOpGradNoNeedBufferVarsInference, "X");
"X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -307,7 +307,7 @@ class MaxPoolWithIndexGradOpMaker : public framework::SingleGradOpMaker<T> { ...@@ -307,7 +307,7 @@ class MaxPoolWithIndexGradOpMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( DECLARE_NO_NEED_BUFFER_VARS_INFERER(
MaxPoolWithIndexOpGradNoNeedBufferVarsInference, "X"); MaxPoolWithIndexOpGradNoNeedBufferVarsInference, "X");
} // namespace operators } // namespace operators
......
...@@ -542,8 +542,8 @@ DECLARE_INPLACE_OP_INFERER(ReshapeGradInplaceInToOut, ...@@ -542,8 +542,8 @@ DECLARE_INPLACE_OP_INFERER(ReshapeGradInplaceInToOut,
{framework::GradVarName("Out"), {framework::GradVarName("Out"),
framework::GradVarName("X")}); framework::GradVarName("X")});
DECLARE_INPLACE_OP_INFERER(ReshapeDoubleGradInplaceInToOut, {"DDX", "DDOut"}); DECLARE_INPLACE_OP_INFERER(ReshapeDoubleGradInplaceInToOut, {"DDX", "DDOut"});
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( DECLARE_NO_NEED_BUFFER_VARS_INFERER(ReshapeDoubleGradOpNoNeedBufferVarInference,
ReshapeDoubleGradOpNoNeedBufferVarInference, "DOut"); "DOut");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -169,7 +169,7 @@ class ROIAlignGradMaker : public framework::SingleGradOpMaker<T> { ...@@ -169,7 +169,7 @@ class ROIAlignGradMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(RoiAlignGradNoNeedBufVarsInferer, "X"); DECLARE_NO_NEED_BUFFER_VARS_INFERER(RoiAlignGradNoNeedBufVarsInferer, "X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -159,7 +159,7 @@ class ScatterNdAddGradMaker : public framework::SingleGradOpMaker<T> { ...@@ -159,7 +159,7 @@ class ScatterNdAddGradMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(ScatterNdAddGradNoNeedBufferVarsInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(ScatterNdAddGradNoNeedBufferVarsInference,
"Updates"); "Updates");
} // namespace operators } // namespace operators
......
...@@ -125,7 +125,7 @@ class ScatterGradMaker : public framework::SingleGradOpMaker<T> { ...@@ -125,7 +125,7 @@ class ScatterGradMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(ScatterGradNoNeedBufferVarsInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(ScatterGradNoNeedBufferVarsInference,
"Updates"); "Updates");
DECLARE_INPLACE_OP_INFERER(ScatterInplaceInferer, {"X", "Out"}); DECLARE_INPLACE_OP_INFERER(ScatterInplaceInferer, {"X", "Out"});
......
...@@ -315,7 +315,7 @@ class SliceDoubleOpGradMaker : public framework::SingleGradOpMaker<T> { ...@@ -315,7 +315,7 @@ class SliceDoubleOpGradMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(SliceOpGradNoNeedBufferVarsInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(SliceOpGradNoNeedBufferVarsInference,
"Input"); "Input");
} // namespace operators } // namespace operators
......
...@@ -131,7 +131,7 @@ class SpaceToDepthOpMaker : public framework::OpProtoAndCheckerMaker { ...@@ -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 <typename T> template <typename T>
class SpaceToDepthGradOpMaker : public framework::SingleGradOpMaker<T> { class SpaceToDepthGradOpMaker : public framework::SingleGradOpMaker<T> {
......
...@@ -71,8 +71,7 @@ class SquaredL2DistanceOp : public framework::OperatorWithKernel { ...@@ -71,8 +71,7 @@ class SquaredL2DistanceOp : public framework::OperatorWithKernel {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(SquaredL2DistanceGradOpNoBuffer, "X", DECLARE_NO_NEED_BUFFER_VARS_INFERER(SquaredL2DistanceGradOpNoBuffer, "X", "Y");
"Y");
template <typename T> template <typename T>
class SquaredL2DistanceGradOpMaker : public framework::SingleGradOpMaker<T> { class SquaredL2DistanceGradOpMaker : public framework::SingleGradOpMaker<T> {
......
...@@ -286,8 +286,7 @@ DECLARE_INPLACE_OP_INFERER(SequeezeInplaceInferer, {"X", "Out"}); ...@@ -286,8 +286,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_INFERENCE(SqueezeGradNoNeedBufferVarsInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(SqueezeGradNoNeedBufferVarsInference, "X");
"X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -272,8 +272,8 @@ class StridedSliceOpGradMaker : public framework::SingleGradOpMaker<T> { ...@@ -272,8 +272,8 @@ class StridedSliceOpGradMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( DECLARE_NO_NEED_BUFFER_VARS_INFERER(StridedSliceOpGradNoNeedBufferVarsInference,
StridedSliceOpGradNoNeedBufferVarsInference, "Input"); "Input");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -163,8 +163,7 @@ class UnfoldGradMaker : public framework::SingleGradOpMaker<T> { ...@@ -163,8 +163,7 @@ class UnfoldGradMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(UnfoldGradOpNoNeedBufferVarsInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(UnfoldGradOpNoNeedBufferVarsInference, "X");
"X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -282,7 +282,7 @@ DECLARE_INPLACE_OP_INFERER(UnsqueezeInplaceInferer, {"X", "Out"}); ...@@ -282,7 +282,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_INFERENCE(UnsqueezeGradOpNoNeedBufferVarInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(UnsqueezeGradOpNoNeedBufferVarInference,
"X"); "X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -178,7 +178,7 @@ class WarpCTCGradOp : public framework::OperatorWithKernel { ...@@ -178,7 +178,7 @@ class WarpCTCGradOp : public framework::OperatorWithKernel {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(WarpCTCGradOpNoNeedBufferVarInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(WarpCTCGradOpNoNeedBufferVarInference,
"Logits"); "Logits");
} // namespace operators } // namespace operators
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册