Skip to content
Snippets Groups Projects
Commit 84fac597 authored by Olivier BICHLER's avatar Olivier BICHLER Committed by Maxence Naud
Browse files

Fix ConstantFolding bug

parent fe867fc3
No related branches found
No related tags found
2 merge requests!318[Upd] release verision 0.5.0,!316Improved scheduling tutorial
......@@ -36,6 +36,7 @@ void Aidge::constantFolding(std::shared_ptr<GraphView> graph) {
for (const auto& node : candidates) {
bool foldable = true;
auto replaceGraph = std::make_shared<GraphView>();
size_t i = 0;
for (const auto& input : node->inputs()) {
if (input.first) {
if (input.first->type() != Producer_Op::Type) {
......@@ -53,6 +54,13 @@ void Aidge::constantFolding(std::shared_ptr<GraphView> graph) {
replaceGraph->add(input.first, false);
}
else if (node->inputCategory(i) != InputCategory::OptionalData
&& node->inputCategory(i) != InputCategory::OptionalParam)
{
foldable = false;
break;
}
++i;
}
if (foldable) {
......
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