mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Gather-Cast, Mul-Cast fusion
This commit is contained in:
@@ -194,15 +194,14 @@ void simplifySubgraphs(const Ptr<ImportGraphWrapper>& net,
|
||||
{
|
||||
int numNodes = net->getNumNodes();
|
||||
std::vector<int> matchedNodesIds, targetNodesIds;
|
||||
for (int i = 0; i < numNodes; ++i)
|
||||
for (int j = 0; j < patterns.size(); ++j)
|
||||
{
|
||||
for (int j = 0; j < patterns.size(); ++j)
|
||||
for (int i = 0; i < numNodes; ++i)
|
||||
{
|
||||
if (patterns[j]->match(net, i, matchedNodesIds, targetNodesIds))
|
||||
{
|
||||
patterns[j]->replace(net, matchedNodesIds, targetNodesIds);
|
||||
numNodes -= matchedNodesIds.size() - 1; // #matchedNodes removed and one added.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user