Skip to content

Commit

Permalink
Merge pull request #7592 from tensor-tang/fixds2
Browse files Browse the repository at this point in the history
fix mkldnn concat dimension issue for rnn
  • Loading branch information
luotao1 authored Jan 17, 2018
2 parents 6f71f89 + 5d22674 commit 939e1b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion paddle/gserver/layers/MKLDNNConcatLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -84,6 +84,7 @@ void MKLDNNConcatLayer::resetFwdBuffers(std::vector<MKLDNNMatrixPtr>& 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
Expand Down

0 comments on commit 939e1b1

Please sign in to comment.