diff --git a/paddle/gserver/layers/MKLDNNConcatLayer.cpp b/paddle/gserver/layers/MKLDNNConcatLayer.cpp index 44bb0883b89c7..520ccc1a995e9 100644 --- a/paddle/gserver/layers/MKLDNNConcatLayer.cpp +++ b/paddle/gserver/layers/MKLDNNConcatLayer.cpp @@ -43,7 +43,7 @@ void MKLDNNConcatLayer::reshape( channels_[0] = ic; oc = ic; for (size_t i = 1; i < inputLayers_.size(); i++) { - int batchsize, height, witdh; + int batchsize = 0, height = 0, witdh = 0; reshapeInput(batchsize, height, witdh, i); CHECK_EQ(bs, batchsize); CHECK_EQ(ih, height); @@ -84,6 +84,7 @@ void MKLDNNConcatLayer::resetFwdBuffers(std::vector& inputs, bool has8c = false, has16c = false, hasnc = false; for (size_t i = 0; i < inputs.size(); i++) { resetInValue(inputs[i], nullptr, i, channels_[i]); + inputs[i]->downSpatial(); CHECK(inputs[i]); auto dm = inputs[i]->getDims(); // inputs format can be different, but ndims must equal