[GNA] Fix accuracy degradation in compact mode (#12150)

This commit is contained in:
Marcin Kusmierski
2022-07-20 12:53:45 +02:00
committed by GitHub
parent fdae2eb8e3
commit 3eafa653f3

View File

@@ -892,18 +892,21 @@ void GNAPlugin::LoadNetwork(const CNNNetwork& _network) {
std::vector<CNNLayerPtr> sortedNoMem;
std::unordered_map<std::string, std::vector<InferenceEngine::CNNLayerPtr>> memoryPairs;
// find all memory layers pairs and mark which one used as outputs
uint16_t id = 0;
int id = 0;
for (auto& layer : sortedNet) {
// set order id for layers to use it in compact mode
LayerInfo layerInfo(layer);
IE_SUPPRESS_DEPRECATED_START
layer->userValue.v_int = id++;
// Increase lifetime of input data buffer needed by DelayedCopy layer to avoid overwritting buffer
// by downstream layers.
layer->userValue.v_int = layerInfo.isCopyDelayed() ? std::numeric_limits<int>::max() : id++;
IE_SUPPRESS_DEPRECATED_END
auto generic = dynamic_cast<GenericLayer*>(layer.get());
if (generic == nullptr) {
sortedNoMem.push_back(layer);
continue;
}
LayerInfo layerInfo(layer);
if (layerInfo.isMemory()) {
// collect all memory pairs
auto id = generic->GetParamAsString("id");