[CPU] Fix problem with inplace input blob (#8506)
This commit is contained in:
parent
b9c5a477b4
commit
b726aa2c9b
@ -425,9 +425,17 @@ void MKLDNNPlugin::MKLDNNInferRequest::SetBlob(const std::string& name, const In
|
||||
IE_THROW(ParameterMismatch) << "Failed to set input blob. Blocking descriptor mismatch.";
|
||||
}
|
||||
|
||||
const auto &actualDesc = graph->getInputNodeByName(name)->getChildEdgesAtPort(0)[0]->getMemory().getDesc();
|
||||
if (blobDesc.getLayout() != InferenceEngine::Layout::ANY &&
|
||||
actualDesc.isCompatible(MemoryDescUtils::convertToCpuBlockedMemoryDesc(blobDesc)) &&
|
||||
MemoryDescPtr actualDesc = graph->getInputNodeByName(name)->getBaseMemDescAtOutputPort(0);
|
||||
bool blobHasAnyLayout = blobDesc.getLayout() == InferenceEngine::Layout::ANY;
|
||||
if (!blobHasAnyLayout && !actualDesc->isDefined()) {
|
||||
// we must define desc for dynamic case
|
||||
// otherwise we got incorrect check on shape compatibility inside isCompatible
|
||||
// because lower and upper bound will be compared
|
||||
actualDesc = actualDesc->cloneWithNewDims(blobDesc.getLayout() == InferenceEngine::Layout::SCALAR ? InferenceEngine::SizeVector{1} :
|
||||
blobDesc.getDims());
|
||||
}
|
||||
if (!blobHasAnyLayout &&
|
||||
actualDesc->isCompatible(MemoryDescUtils::convertToCpuBlockedMemoryDesc(blobDesc)) &&
|
||||
graph->_normalizePreprocMap.find(name) == graph->_normalizePreprocMap.end() && !graph->getProperty().batchLimit) {
|
||||
externalPtr[name] = data->buffer();
|
||||
} else if (externalPtr.find(name) != externalPtr.end()) {
|
||||
|
@ -254,7 +254,16 @@ std::vector<std::vector<ov::Shape>> staticInputShapes5D2 = {
|
||||
std::vector<std::vector<InputShape>> dynamicInputShapes5D2 = {
|
||||
{
|
||||
{{{-1, -1, -1, -1, -1}, {{48, 4, 3, 3, 3}, {24, 16, 5, 3, 5}, {24, 8, 7, 5, 5}}}},
|
||||
{{{24, {8, 16}, {3, 5}, -1, -1}, {{24, 16, 3, 4, 3}, {24, 12, 5, 3, 5}, {24, 8, 4, 5, 5}}}}
|
||||
{{{24, {8, 16}, {3, 5}, -1, -1}, {{24, 16, 3, 4, 3}, {24, 12, 5, 3, 5}, {24, 8, 4, 5, 5}}}},
|
||||
// special case
|
||||
{
|
||||
{{{1, 24}, {1, 16}, {1, 10}, {1, 10}, {1, 10}},
|
||||
{
|
||||
{24, 16, 5, 3, 5},
|
||||
{24, 16, 5, 3, 5},
|
||||
{24, 16, 7, 5, 5}
|
||||
}}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user