From: dmitrygo Date: Thu, 4 Jun 2020 17:13:59 +0000 (+0300) Subject: [CPU] Fixed weights candidate initialization in FC node X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7313bab7feff4bd1c1a8442da3048741cf4bcdd;p=platform%2Fupstream%2Fdldt.git [CPU] Fixed weights candidate initialization in FC node --- diff --git a/inference-engine/src/mkldnn_plugin/nodes/mkldnn_fullyconnected_node.cpp b/inference-engine/src/mkldnn_plugin/nodes/mkldnn_fullyconnected_node.cpp index af53146..4717e06 100644 --- a/inference-engine/src/mkldnn_plugin/nodes/mkldnn_fullyconnected_node.cpp +++ b/inference-engine/src/mkldnn_plugin/nodes/mkldnn_fullyconnected_node.cpp @@ -101,11 +101,12 @@ void MKLDNNFullyConnectedNode::getSupportedDescriptors() { THROW_IE_EXCEPTION << "Incorrect number of output edges for layer " << getName(); MKLDNNDims inDims(fcLayer->input()->getDims()); + MKLDNNDims outDims(fcLayer->outData[0]->getDims()); if (inDims.ndims() == 2) { weightsDims = {fcLayer->_out_num, static_cast(inDims[1])}; } else if (inDims.ndims() == 3) { - weightsDims = {fcLayer->_out_num, static_cast(inDims[2])}; + weightsDims = {static_cast(outDims[2]), static_cast(inDims[2])}; } else if (inDims.ndims() == 4) { weightsDims = {fcLayer->_out_num, static_cast(inDims[1]), static_cast(inDims[2]), static_cast(inDims[3])}; @@ -122,7 +123,11 @@ void MKLDNNFullyConnectedNode::getSupportedDescriptors() { } withBiases = (fcLayer->_biases != nullptr && fcLayer->_biases->size() != 0) || baseInputsNumber == 3; - biasesDims.push_back(static_cast(fcLayer->_out_num)); + if (inDims.ndims() == 3) { + biasesDims.push_back(static_cast(outDims[2])); + } else { + biasesDims.push_back(static_cast(fcLayer->_out_num)); + } if (withBiases && baseInputsNumber == 1) { internalBlobs.push_back(createInternalBlob(biasesDims, false)); }