From 5aa3e768cdd26005779abfd84742bbc5b8d3b025 Mon Sep 17 00:00:00 2001 From: xzl Date: Mon, 13 Nov 2017 17:52:08 +0800 Subject: [PATCH] fix bug with default parameter --- paddle/cuda/include/stub/hl_cnn_stub.h | 2 +- paddle/gserver/layers/PoolProjection.cpp | 1 - paddle/gserver/layers/PoolProjection.h | 2 +- paddle/gserver/layers/PoolProjectionLayer.cpp | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/paddle/cuda/include/stub/hl_cnn_stub.h b/paddle/cuda/include/stub/hl_cnn_stub.h index fc22da024b9..968ed4840ff 100644 --- a/paddle/cuda/include/stub/hl_cnn_stub.h +++ b/paddle/cuda/include/stub/hl_cnn_stub.h @@ -32,7 +32,7 @@ inline void hl_maxpool_forward(const int frameCnt, const int paddingW, real* tgtData, const int tgtStride, - real* MaskData = NULL) {} + real* MaskData) {} inline void hl_maxpool_backward(const int frameCnt, const real* inputData, diff --git a/paddle/gserver/layers/PoolProjection.cpp b/paddle/gserver/layers/PoolProjection.cpp index 5fa68b2c545..d90b438448e 100644 --- a/paddle/gserver/layers/PoolProjection.cpp +++ b/paddle/gserver/layers/PoolProjection.cpp @@ -84,7 +84,6 @@ void MaxPoolProjection::forward() { CHECK_EQ(width, out_->value->getWidth()); MatrixPtr inputV = in_->value; MatrixPtr outV = out_->value; - outV->maxPoolForward(*inputV, imgSizeY_, imgSize_, diff --git a/paddle/gserver/layers/PoolProjection.h b/paddle/gserver/layers/PoolProjection.h index ce0584d7b0f..9a75f465f6f 100644 --- a/paddle/gserver/layers/PoolProjection.h +++ b/paddle/gserver/layers/PoolProjection.h @@ -37,6 +37,7 @@ public: static PoolProjection* create(const ProjectionConfig& config, ParameterPtr parameter, bool useGpu); + const std::string& getPoolType() const { return poolType_; } size_t getSize(); @@ -63,5 +64,4 @@ public: virtual void forward(); virtual void backward(const UpdateCallback& callback = nullptr); }; - } // namespace paddle diff --git a/paddle/gserver/layers/PoolProjectionLayer.cpp b/paddle/gserver/layers/PoolProjectionLayer.cpp index 7334c3b051b..ed5011ab899 100644 --- a/paddle/gserver/layers/PoolProjectionLayer.cpp +++ b/paddle/gserver/layers/PoolProjectionLayer.cpp @@ -51,7 +51,6 @@ void PoolProjectionLayer::forward(PassType passType) { const Argument& in = getInput(0); int batchSize = in.value->getHeight(); int size = getSize(); - resetOutput(batchSize, size); poolProjection_->forward(&in, &output_, passType); } -- GitLab