Skip to content
Snippets Groups Projects
Commit 2659ce34 authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Fixed GraphMatching

parent b1097ce8
No related branches found
No related tags found
2 merge requests!212Version 0.3.0,!189Improve Remove Flatten
...@@ -642,6 +642,10 @@ bool Aidge::SinglePassGraphMatching::matchNode(Context& ctx, std::set<MatchingRe ...@@ -642,6 +642,10 @@ bool Aidge::SinglePassGraphMatching::matchNode(Context& ctx, std::set<MatchingRe
for (const auto& output : outputs) { for (const auto& output : outputs) {
for (const auto& node : output) { for (const auto& node : output) {
if (!node.first) {
continue;
}
if (newCtx.edgeRightIdx == gk_IODefaultIndex || node.second == newCtx.edgeRightIdx) { if (newCtx.edgeRightIdx == gk_IODefaultIndex || node.second == newCtx.edgeRightIdx) {
if (mGraph->inView(node.first) && !it->graph->inView(node.first)) { if (mGraph->inView(node.first) && !it->graph->inView(node.first)) {
found = true; found = true;
...@@ -663,6 +667,10 @@ bool Aidge::SinglePassGraphMatching::matchNode(Context& ctx, std::set<MatchingRe ...@@ -663,6 +667,10 @@ bool Aidge::SinglePassGraphMatching::matchNode(Context& ctx, std::set<MatchingRe
: it->startNode->inputs(); : it->startNode->inputs();
for (const auto& input : inputs) { for (const auto& input : inputs) {
if (!input.first) {
continue;
}
if (newCtx.edgeRightIdx == gk_IODefaultIndex || input.second == newCtx.edgeRightIdx) { if (newCtx.edgeRightIdx == gk_IODefaultIndex || input.second == newCtx.edgeRightIdx) {
if (mGraph->inView(input.first) && !it->graph->inView(input.first)) { if (mGraph->inView(input.first) && !it->graph->inView(input.first)) {
found = true; found = true;
...@@ -741,6 +749,10 @@ bool Aidge::SinglePassGraphMatching::matchNode(Context& ctx, std::set<MatchingRe ...@@ -741,6 +749,10 @@ bool Aidge::SinglePassGraphMatching::matchNode(Context& ctx, std::set<MatchingRe
} }
for (const auto& node : output) { for (const auto& node : output) {
if (!node.first) {
continue;
}
if ((type.empty() || node.first->type() == type) if ((type.empty() || node.first->type() == type)
&& (lambda.empty() || mLambda.at(lambda)(node.first)) && (lambda.empty() || mLambda.at(lambda)(node.first))
&& (newCtx.edgeRightIdx == gk_IODefaultIndex || node.second == newCtx.edgeRightIdx)) && (newCtx.edgeRightIdx == gk_IODefaultIndex || node.second == newCtx.edgeRightIdx))
...@@ -775,6 +787,10 @@ bool Aidge::SinglePassGraphMatching::matchNode(Context& ctx, std::set<MatchingRe ...@@ -775,6 +787,10 @@ bool Aidge::SinglePassGraphMatching::matchNode(Context& ctx, std::set<MatchingRe
: it->startNode->inputs(); : it->startNode->inputs();
for (const auto& input : inputs) { for (const auto& input : inputs) {
if (!input.first) {
continue;
}
if ((type.empty() || input.first->type() == type) if ((type.empty() || input.first->type() == type)
&& (lambda.empty() || mLambda.at(lambda)(input.first)) && (lambda.empty() || mLambda.at(lambda)(input.first))
&& (newCtx.edgeRightIdx == gk_IODefaultIndex || input.second == newCtx.edgeRightIdx)) && (newCtx.edgeRightIdx == gk_IODefaultIndex || input.second == newCtx.edgeRightIdx))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment