Skip to content

Commit 939e1b1

Browse files
authored
Merge pull request #7592 from tensor-tang/fixds2
fix mkldnn concat dimension issue for rnn
2 parents 6f71f89 + 5d22674 commit 939e1b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddle/gserver/layers/MKLDNNConcatLayer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void MKLDNNConcatLayer::reshape(
4343
channels_[0] = ic;
4444
oc = ic;
4545
for (size_t i = 1; i < inputLayers_.size(); i++) {
46-
int batchsize, height, witdh;
46+
int batchsize = 0, height = 0, witdh = 0;
4747
reshapeInput(batchsize, height, witdh, i);
4848
CHECK_EQ(bs, batchsize);
4949
CHECK_EQ(ih, height);
@@ -84,6 +84,7 @@ void MKLDNNConcatLayer::resetFwdBuffers(std::vector<MKLDNNMatrixPtr>& inputs,
8484
bool has8c = false, has16c = false, hasnc = false;
8585
for (size_t i = 0; i < inputs.size(); i++) {
8686
resetInValue(inputs[i], nullptr, i, channels_[i]);
87+
inputs[i]->downSpatial();
8788
CHECK(inputs[i]);
8889
auto dm = inputs[i]->getDims();
8990
// inputs format can be different, but ndims must equal

0 commit comments

Comments
 (0)