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

rename no_need_buffer_vars_macro, test=develop (#23159)

上级 bae5930b
...@@ -96,6 +96,9 @@ class NoNeedBufferVarsInference { ...@@ -96,6 +96,9 @@ 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()(
......
...@@ -48,7 +48,7 @@ TEST(test_no_need_buffer_vars_inference, test_dygraph) { ...@@ -48,7 +48,7 @@ TEST(test_no_need_buffer_vars_inference, test_dygraph) {
ASSERT_TRUE(boost::get<bool>(ctx.GetAttr("is_test"))); ASSERT_TRUE(boost::get<bool>(ctx.GetAttr("is_test")));
} }
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(TestNoNeedBufferVarsInferer, "X1", "X2"); DECLARE_NO_NEED_BUFFER_VARS_INFERER(TestNoNeedBufferVarsInferer, "X1", "X2");
TEST(test_no_need_buffer_vars_inference, test_nullptr_comparation) { TEST(test_no_need_buffer_vars_inference, test_nullptr_comparation) {
InferNoNeedBufferVarsFN infer_fn; InferNoNeedBufferVarsFN infer_fn;
......
...@@ -118,7 +118,7 @@ class ArgsortGradOpMaker : public framework::SingleGradOpMaker<T> { ...@@ -118,7 +118,7 @@ class ArgsortGradOpMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(ArgsortGradNoNeedBufferVarInference, "X"); DECLARE_NO_NEED_BUFFER_VARS_INFERER(ArgsortGradNoNeedBufferVarInference, "X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -74,8 +74,8 @@ class BatchSizeLikeOpMaker : public framework::OpProtoAndCheckerMaker { ...@@ -74,8 +74,8 @@ class BatchSizeLikeOpMaker : public framework::OpProtoAndCheckerMaker {
virtual void Apply() = 0; virtual void Apply() = 0;
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(BatchSizeLikeNoNeedBufferVarsInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(BatchSizeLikeNoNeedBufferVarsInference,
"Input"); "Input");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
...@@ -140,7 +140,7 @@ class CenterLossOpGradMaker : public framework::SingleGradOpMaker<T> { ...@@ -140,7 +140,7 @@ class CenterLossOpGradMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(CenterLossGradNoNeedBufVarsInferer, "X"); DECLARE_NO_NEED_BUFFER_VARS_INFERER(CenterLossGradNoNeedBufVarsInferer, "X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -176,8 +176,7 @@ class ConcatOpGrad : public framework::OperatorWithKernel { ...@@ -176,8 +176,7 @@ class ConcatOpGrad : public framework::OperatorWithKernel {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(ConcatOpGradNoNeedBufferVarInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(ConcatOpGradNoNeedBufferVarInference, "X");
"X");
template <typename T> template <typename T>
class ConcatGradOpMaker : public framework::SingleGradOpMaker<T> { class ConcatGradOpMaker : public framework::SingleGradOpMaker<T> {
......
...@@ -199,7 +199,7 @@ class CropGradOpMaker : public framework::SingleGradOpMaker<T> { ...@@ -199,7 +199,7 @@ class CropGradOpMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(GropNoNeedBufferVarInference, "Y"); DECLARE_NO_NEED_BUFFER_VARS_INFERER(GropNoNeedBufferVarInference, "Y");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -141,8 +141,8 @@ class CVMGradOpMaker : public framework::SingleGradOpMaker<T> { ...@@ -141,8 +141,8 @@ class CVMGradOpMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(CVMNoNeedBufferVarInference, "CVM"); DECLARE_NO_NEED_BUFFER_VARS_INFERER(CVMNoNeedBufferVarInference, "CVM");
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(CVMGradNoNeedBufferVarInference, "X"); DECLARE_NO_NEED_BUFFER_VARS_INFERER(CVMGradNoNeedBufferVarInference, "X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -82,8 +82,8 @@ class ReduceMeanDoubleGradOpBaseMaker : public imperative::GradOpBaseMakerBase { ...@@ -82,8 +82,8 @@ class ReduceMeanDoubleGradOpBaseMaker : public imperative::GradOpBaseMakerBase {
} }
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(ReduceMeanGradNoNeedBufferVarInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(ReduceMeanGradNoNeedBufferVarInference,
"X"); "X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -37,8 +37,7 @@ class ReduceSumOpGradMaker : public framework::SingleGradOpMaker<T> { ...@@ -37,8 +37,7 @@ class ReduceSumOpGradMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(ReduceSumGradNoNeedBufferVarInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(ReduceSumGradNoNeedBufferVarInference, "X");
"X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -110,8 +110,8 @@ class SeqConcatGradOp : public framework::OperatorWithKernel { ...@@ -110,8 +110,8 @@ class SeqConcatGradOp : public framework::OperatorWithKernel {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(SeqConcatGradNoNeedBufferVarsInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(SeqConcatGradNoNeedBufferVarsInference,
"X"); "X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -175,9 +175,9 @@ class SequenceExpandAsOpGradOpMaker : public framework::SingleGradOpMaker<T> { ...@@ -175,9 +175,9 @@ class SequenceExpandAsOpGradOpMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( DECLARE_NO_NEED_BUFFER_VARS_INFERER(SequenceExpandAsOpNoNeedBufferVarsInference,
SequenceExpandAsOpNoNeedBufferVarsInference, "Y"); "Y");
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( DECLARE_NO_NEED_BUFFER_VARS_INFERER(
SequenceExpandAsGradOpNoNeedBufferVarsInference, "X", "Y"); SequenceExpandAsGradOpNoNeedBufferVarsInference, "X", "Y");
} // namespace operators } // namespace operators
......
...@@ -230,9 +230,9 @@ class SequenceExpandOpGradMaker : public framework::SingleGradOpMaker<T> { ...@@ -230,9 +230,9 @@ class SequenceExpandOpGradMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE(SequenceExpandOpNoNeedBufferVarsInference, DECLARE_NO_NEED_BUFFER_VARS_INFERER(SequenceExpandOpNoNeedBufferVarsInference,
"Y"); "Y");
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( DECLARE_NO_NEED_BUFFER_VARS_INFERER(
SequenceExpandGradOpNoNeedBufferVarsInference, "X", "Y"); SequenceExpandGradOpNoNeedBufferVarsInference, "X", "Y");
} // namespace operators } // namespace operators
......
...@@ -220,8 +220,8 @@ class SequencePadGradOpMaker : public framework::SingleGradOpMaker<T> { ...@@ -220,8 +220,8 @@ class SequencePadGradOpMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( DECLARE_NO_NEED_BUFFER_VARS_INFERER(SequencePadGradOpNoNeedBufferVarsInference,
SequencePadGradOpNoNeedBufferVarsInference, "X"); "X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -157,8 +157,8 @@ class SequencePoolGradOpMaker : public framework::SingleGradOpMaker<T> { ...@@ -157,8 +157,8 @@ class SequencePoolGradOpMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( DECLARE_NO_NEED_BUFFER_VARS_INFERER(SequencePoolGradOpNoNeedBufferVarsInference,
SequencePoolGradOpNoNeedBufferVarsInference, "X"); "X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -157,7 +157,7 @@ class SequenceScatterGradMaker : public framework::SingleGradOpMaker<T> { ...@@ -157,7 +157,7 @@ class SequenceScatterGradMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( DECLARE_NO_NEED_BUFFER_VARS_INFERER(
SequenceScatterGradNoNeedBufferVarsInference, "Updates"); SequenceScatterGradNoNeedBufferVarsInference, "Updates");
} // namespace operators } // namespace operators
......
...@@ -133,8 +133,8 @@ class SequenceSliceGradOpMaker : public framework::SingleGradOpMaker<T> { ...@@ -133,8 +133,8 @@ class SequenceSliceGradOpMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( DECLARE_NO_NEED_BUFFER_VARS_INFERER(SequenceSliceGradNoNeedBufferVarsInference,
SequenceSliceGradNoNeedBufferVarsInference, "X"); "X");
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
......
...@@ -151,7 +151,7 @@ class SequenceSoftmaxGradOp : public framework::OperatorWithKernel { ...@@ -151,7 +151,7 @@ class SequenceSoftmaxGradOp : public framework::OperatorWithKernel {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( DECLARE_NO_NEED_BUFFER_VARS_INFERER(
SequenceSoftmaxGradOpNoNeedBufferVarsInferer, "X"); SequenceSoftmaxGradOpNoNeedBufferVarsInferer, "X");
} // namespace operators } // namespace operators
......
...@@ -151,7 +151,7 @@ class SequenceUnpadGradOpMaker : public framework::SingleGradOpMaker<T> { ...@@ -151,7 +151,7 @@ class SequenceUnpadGradOpMaker : public framework::SingleGradOpMaker<T> {
} }
}; };
DECLARE_NO_NEED_BUFFER_VARS_INFERENCE( DECLARE_NO_NEED_BUFFER_VARS_INFERER(
SequenceUnpadGradOpNoNeedBufferVarsInference, "X"); SequenceUnpadGradOpNoNeedBufferVarsInference, "X");
} // namespace operators } // namespace operators
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册