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

Fixed issue

parent c64a6b94
No related branches found
No related tags found
2 merge requests!212Version 0.3.0,!170Change fuseMulAdd
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
void Aidge::matMulToFC(std::shared_ptr<Aidge::Node> matmulNode, std::shared_ptr<Aidge::Node> addNode) { void Aidge::matMulToFC(std::shared_ptr<Aidge::Node> matmulNode, std::shared_ptr<Aidge::Node> addNode) {
// Fuse Mulmat & Add into FC // Fuse Mulmat & Add into FC
// Inputs : old nodes (pointers on mul & add) // Inputs : old nodes (pointers on mul & add)
AIDGE_ASSERT((matmulNode->type() == "MatMul" && (addNode == nullptr || addNode->type() == "Add")), "Wrong type for the nodes to replace"); AIDGE_ASSERT((matmulNode->type() == "MatMul" && (addNode == nullptr || addNode->type() == "Add")),
"Wrong type for the nodes to replace: {} and {}",
matmulNode->type(), (addNode) ? addNode->type() : "nullptr");
// Step 1 : Create FC // Step 1 : Create FC
...@@ -103,6 +105,6 @@ void Aidge::matMulToFC(std::shared_ptr<Aidge::GraphView> graphView){ ...@@ -103,6 +105,6 @@ void Aidge::matMulToFC(std::shared_ptr<Aidge::GraphView> graphView){
for (const auto& match : matches) { for (const auto& match : matches) {
const auto it = match.anchors.find("Add"); const auto it = match.anchors.find("Add");
matMulToFC(match.startNode, (it != match.anchors.end()) ? it->second.at("#") : nullptr); matMulToFC(match.graph->rootNode(), (it != match.anchors.end()) ? it->second.at("#") : nullptr);
} }
} }
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