[CPU] Supported ANY layout for inputs in inferRequest (#4621)

This commit is contained in:
Gorokhov Dmitriy 2021-03-05 12:30:26 +03:00 committed by GitHub
parent 4675a12c8f
commit c4ff0ffa9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@
#include <nodes/mkldnn_concat_node.h>
#include <nodes/mkldnn_split_node.h>
#include <ie_compound_blob.h>
#include <ie_common.h>
#include "mkldnn_exec_network.h"
#include "mkldnn_itt.h"
#include "nodes/common/cpu_convert.h"
@ -128,6 +129,13 @@ void MKLDNNPlugin::MKLDNNInferRequest::PushInputData() {
default:
THROW_IE_EXCEPTION << "Unsupported input precision " << input.second->getTensorDesc().getPrecision();
}
// User can initialize input via setBlob API using tensorDesc with default (ANY) layout.
// Currently IE doesn't specify behavior in such scenario, so we assume real layout is equal to the network input.
if (input.second->getTensorDesc().getLayout() == InferenceEngine::ANY) {
input.second->getTensorDesc().setLayout(_networkInputs[input.first]->getLayout());
}
pushInput(input.first, input.second, inPrec);
}
}