From 70bd07a0e1260542a14ff8845e124108a44520b4 Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Thu, 27 Jul 2017 11:26:41 +0800 Subject: [PATCH] Fix compile errors of FillZerosLikeOp --- paddle/operators/CMakeLists.txt | 1 + paddle/operators/fill_zeros_like_op.cc | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/paddle/operators/CMakeLists.txt b/paddle/operators/CMakeLists.txt index 0a14dc21144..644460ee473 100644 --- a/paddle/operators/CMakeLists.txt +++ b/paddle/operators/CMakeLists.txt @@ -49,6 +49,7 @@ op_library(rowwise_add_op SRCS rowwise_add_op.cu rowwise_add_op.cc) op_library(sigmoid_op SRCS sigmoid_op.cu sigmoid_op.cc) op_library(softmax_op SRCS softmax_op.cc softmax_op.cu) op_library(cross_entropy_op SRCS cross_entropy_op.cc cross_entropy_op.cu) +op_library(fill_zeros_like_op SRCS fill_zeros_like_op.cc fill_zeros_like_op.cu) op_library(fc_op SRCS fc_op.cc DEPS mul_op rowwise_add_op sigmoid_op softmax_op net) diff --git a/paddle/operators/fill_zeros_like_op.cc b/paddle/operators/fill_zeros_like_op.cc index 3df3a2cfab6..d641bc4adaf 100644 --- a/paddle/operators/fill_zeros_like_op.cc +++ b/paddle/operators/fill_zeros_like_op.cc @@ -19,16 +19,16 @@ limitations under the License. */ namespace paddle { namespace operators { -class FillZerosLike : public framework::OperatorWithKernel { +class FillZerosLikeOp : public framework::OperatorWithKernel { protected: void InferShape( const std::vector &inputs, const std::vector &outputs) const override { PADDLE_ENFORCE(inputs.size() == 1, - "Input size of FillZerosLike must be one."); + "Input size of FillZerosLikeOp must be one."); PADDLE_ENFORCE(outputs.size() == 1, "Output size of AddOp must be one."); PADDLE_ENFORCE(inputs[0] != nullptr && outputs[0] != nullptr, - "Outputs of FillZerosLike must all be set."); + "Outputs of FillZerosLikeOp must all be set."); outputs[0]->Resize(inputs[0]->dims()); } }; @@ -44,7 +44,7 @@ public: Fill up a vriable with zeros. The output will have the same size with input. -)DOC") +)DOC"); } }; } // namespace operators @@ -53,6 +53,6 @@ The output will have the same size with input. REGISTER_OP(fill_zeros_like, paddle::operators::FillZerosLikeOp, paddle::operators::FillZerosLikeOpMaker); -EGISTER_OP_CPU_KERNEL( +REGISTER_OP_CPU_KERNEL( fill_zeros_like, - paddle::operators::FillZerosLikeKernal); \ No newline at end of file + paddle::operators::FillZerosLikeKernel); -- GitLab