提交 d373c100 编写于 作者: L liaogang

Fix bilinear interp bug

上级 45b8c47e
......@@ -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
......
......@@ -1275,7 +1275,7 @@ void GpuMatrix::bilinearBackward(const Matrix& out,
static_cast<real>(inImgW - 1) / (outImgW - 1) : 0.f;
if (outImgH == inImgH && outImgW == inImgW) {
this->copyFrom(out);
this->addBias(const_cast<Matrix&>(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<real>(inImgW - 1) / (outImgW - 1) : 0.f;
if (inImgH == outImgH && inImgW == outImgW) {
this->copyFrom(out);
this->addBias(const_cast<Matrix&>(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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册