Fix bilinear interp bug

avx_docs
liaogang 8 years ago
parent 45b8c47e04
commit d373c10091

@ -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

Loading…
Cancel
Save