[CPU] Fixed weights candidate initialization in FC node
This commit is contained in:
parent
d798831c95
commit
c7313bab7f
@ -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<size_t>(inDims[1])};
|
||||
} else if (inDims.ndims() == 3) {
|
||||
weightsDims = {fcLayer->_out_num, static_cast<size_t>(inDims[2])};
|
||||
weightsDims = {static_cast<size_t>(outDims[2]), static_cast<size_t>(inDims[2])};
|
||||
} else if (inDims.ndims() == 4) {
|
||||
weightsDims = {fcLayer->_out_num, static_cast<size_t>(inDims[1]), static_cast<size_t>(inDims[2]),
|
||||
static_cast<size_t>(inDims[3])};
|
||||
@ -122,7 +123,11 @@ void MKLDNNFullyConnectedNode::getSupportedDescriptors() {
|
||||
}
|
||||
|
||||
withBiases = (fcLayer->_biases != nullptr && fcLayer->_biases->size() != 0) || baseInputsNumber == 3;
|
||||
biasesDims.push_back(static_cast<int>(fcLayer->_out_num));
|
||||
if (inDims.ndims() == 3) {
|
||||
biasesDims.push_back(static_cast<int>(outDims[2]));
|
||||
} else {
|
||||
biasesDims.push_back(static_cast<int>(fcLayer->_out_num));
|
||||
}
|
||||
if (withBiases && baseInputsNumber == 1) {
|
||||
internalBlobs.push_back(createInternalBlob(biasesDims, false));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user