21 originalLayers.sort();
25 for (
auto& failed : m_FailedOptimizations)
27 countedLayers.insert(countedLayers.end(),
28 failed.GetIConnectableLayers().begin(),
29 failed.GetIConnectableLayers().end());
31 for (
auto& untouched : m_UntouchedSubgraphs)
33 countedLayers.insert(countedLayers.end(),
34 untouched.GetIConnectableLayers().begin(),
35 untouched.GetIConnectableLayers().end());
37 for (
auto& successful : m_SuccesfulOptimizations)
39 countedLayers.insert(countedLayers.end(),
40 successful.m_SubstitutableSubgraph.GetIConnectableLayers().begin(),
41 successful.m_SubstitutableSubgraph.GetIConnectableLayers().end());
43 for (
auto& successful : m_DeletedSubgraphs)
45 countedLayers.insert(countedLayers.end(),
46 successful.GetIConnectableLayers().begin(),
47 successful.GetIConnectableLayers().end());
52 valid &= originalLayers.size() == countedLayers.size();
54 auto oIt = originalLayers.begin();
55 auto cIt = countedLayers.begin();
56 for (
size_t i=0; i < originalLayers.size() && valid; ++i, ++oIt, ++cIt)
58 valid &= (*oIt == *cIt);
64 for (
auto& substitution : m_SuccesfulOptimizations)
66 bool validSubstitution =
true;
67 const SubgraphView& replacement = substitution.m_ReplacementSubgraph;
68 const SubgraphView& old = substitution.m_SubstitutableSubgraph;
71 valid &= validSubstitution;