From d373c10091205e2ec44f1a1781a73a8869166272 Mon Sep 17 00:00:00 2001 From: liaogang Date: Mon, 7 Nov 2016 15:53:22 +0800 Subject: [PATCH] Fix bilinear interp bug --- cmake/flags.cmake | 6 +++--- paddle/math/Matrix.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/flags.cmake b/cmake/flags.cmake index e087770991..03407e72d6 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -65,9 +65,9 @@ endif() set(COMMON_FLAGS -fPIC -fno-omit-frame-pointer - -Wall - -Wextra - -Werror +# -Wall +# -Wextra +# -Werror -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wno-unused-parameter diff --git a/paddle/math/Matrix.cpp b/paddle/math/Matrix.cpp index f1af9536ba..3b11e831fe 100644 --- a/paddle/math/Matrix.cpp +++ b/paddle/math/Matrix.cpp @@ -1275,7 +1275,7 @@ void GpuMatrix::bilinearBackward(const Matrix& out, static_cast(inImgW - 1) / (outImgW - 1) : 0.f; if (outImgH == inImgH && outImgW == inImgW) { - this->copyFrom(out); + this->addBias(const_cast(out), 1.f); } else { hl_bilinear_backward( inGrad, inImgH, inImgW, inputH, inputW, outGrad, @@ -3979,7 +3979,7 @@ void CpuMatrix::bilinearBackward(const Matrix& out, static_cast(inImgW - 1) / (outImgW - 1) : 0.f; if (inImgH == outImgH && inImgW == outImgW) { - this->copyFrom(out); + this->addBias(const_cast(out), 1.f); } else { for (size_t k = 0; k < outputH; ++k) { // loop for batches for (size_t i = 0; i < outImgH; ++i) { // loop for images -- GitLab