fixed code and updated unit tests to accomodate auto-reshaping graphs, to unlock full validation (#1808)

This commit is contained in:
Maxim Shevtsov
2020-08-17 20:17:30 +03:00
committed by GitHub
parent e8a178e196
commit 05a57ebd8e
2 changed files with 9 additions and 2 deletions

View File

@@ -24,7 +24,9 @@ MKLDNNPlugin::MKLDNNInferRequest::MKLDNNInferRequest(InferenceEngine::InputsData
if (execNetwork->_graphs.size() == 0)
THROW_IE_EXCEPTION << "No graph was found";
const int seq = (_networkInputs.cbegin()->second->getTensorDesc().getDims())[1];
const int seq = execNetwork->_graphs.begin()->size() > 1
? _networkInputs.cbegin()->second->getTensorDesc().getDims()[1]
: 0;
graph = execNetwork->_graphs.begin()->at(seq).get();
for (const auto& it : _networkInputs) {
InferenceEngine::Blob::Ptr blob;

View File

@@ -162,7 +162,12 @@ Engine::LoadExeNetworkImpl(const InferenceEngine::ICNNNetwork &network, const st
const InputsDataMap inputInfo = localNetwork.getInputsInfo();
ICNNNetwork::InputShapes shapes = localNetwork.getInputShapes();
ReshapedCNNNetworks reshapedNetworks;
int seq = shapes.at(inputInfo.cbegin()->first)[1];
int seq = 0;
if (conf.dynamicSequence) {
if (shapes.at(inputInfo.cbegin()->first).size() < 2)
THROW_IE_EXCEPTION << "Auto-reshaping of the network with no sequence (first input is scalar or channels-only)!";
seq = shapes.at(inputInfo.cbegin()->first)[1];
}
do {
CNNNetwork clonedNetwork(cloneNetwork(network));
if (conf.dynamicSequence) {