提交 d373c100 编写于 作者: L liaogang

Fix bilinear interp bug

上级 45b8c47e
...@@ -65,9 +65,9 @@ endif() ...@@ -65,9 +65,9 @@ endif()
set(COMMON_FLAGS set(COMMON_FLAGS
-fPIC -fPIC
-fno-omit-frame-pointer -fno-omit-frame-pointer
-Wall # -Wall
-Wextra # -Wextra
-Werror # -Werror
-Wnon-virtual-dtor -Wnon-virtual-dtor
-Wdelete-non-virtual-dtor -Wdelete-non-virtual-dtor
-Wno-unused-parameter -Wno-unused-parameter
......
...@@ -1275,7 +1275,7 @@ void GpuMatrix::bilinearBackward(const Matrix& out, ...@@ -1275,7 +1275,7 @@ void GpuMatrix::bilinearBackward(const Matrix& out,
static_cast<real>(inImgW - 1) / (outImgW - 1) : 0.f; static_cast<real>(inImgW - 1) / (outImgW - 1) : 0.f;
if (outImgH == inImgH && outImgW == inImgW) { if (outImgH == inImgH && outImgW == inImgW) {
this->copyFrom(out); this->addBias(const_cast<Matrix&>(out), 1.f);
} else { } else {
hl_bilinear_backward( hl_bilinear_backward(
inGrad, inImgH, inImgW, inputH, inputW, outGrad, inGrad, inImgH, inImgW, inputH, inputW, outGrad,
...@@ -3979,7 +3979,7 @@ void CpuMatrix::bilinearBackward(const Matrix& out, ...@@ -3979,7 +3979,7 @@ void CpuMatrix::bilinearBackward(const Matrix& out,
static_cast<real>(inImgW - 1) / (outImgW - 1) : 0.f; static_cast<real>(inImgW - 1) / (outImgW - 1) : 0.f;
if (inImgH == outImgH && inImgW == outImgW) { if (inImgH == outImgH && inImgW == outImgW) {
this->copyFrom(out); this->addBias(const_cast<Matrix&>(out), 1.f);
} else { } else {
for (size_t k = 0; k < outputH; ++k) { // loop for batches for (size_t k = 0; k < outputH; ++k) { // loop for batches
for (size_t i = 0; i < outImgH; ++i) { // loop for images for (size_t i = 0; i < outImgH; ++i) { // loop for images
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册