Skip to content
Snippets Groups Projects
Commit 859227aa authored by Thibault Allenet's avatar Thibault Allenet
Browse files

Change remove_flatten to take in a node instead of a graphView

parent 0ac0b9b4
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ namespace py = pybind11; ...@@ -21,7 +21,7 @@ namespace py = pybind11;
namespace Aidge { namespace Aidge {
void init_Recipies(py::module &m) { void init_Recipies(py::module &m) {
m.def("fuse_mul_add", &fuseMulAdd, py::arg("nodes")); m.def("fuse_mul_add", &fuseMulAdd, py::arg("nodes"));
m.def("remove_flatten", &removeFlatten, py::arg("view")); m.def("remove_flatten", &removeFlatten, py::arg("nodes"));
} }
} // namespace Aidge } // namespace Aidge
...@@ -16,13 +16,9 @@ ...@@ -16,13 +16,9 @@
#include "aidge/utils/Recipies.hpp" #include "aidge/utils/Recipies.hpp"
namespace Aidge { namespace Aidge {
void removeFlatten(std::shared_ptr<GraphView> view) { void removeFlatten(std::set<std::shared_ptr<Node>> nodes) {
for (auto& nodePtr : view->getNodes()) { auto g = std::make_shared<GraphView>();
if (nodePtr->type() == "Flatten") { g->add(std::set<std::shared_ptr<Node>>({nodes}));
auto g = std::make_shared<GraphView>(); g->replaceWith({});
g->add(std::set<std::shared_ptr<Node>>({nodePtr}));
g->replaceWith({});
}
}
} }
} }
\ No newline at end of file
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