Skip to content
Snippets Groups Projects
Commit c3b64dd1 authored by Benjamin Halimi's avatar Benjamin Halimi
Browse files

modify prepareNetwork()

parent f3d41082
No related tags found
2 merge requests!54Update 0.3.1 -> 0.4.0,!45Add support for the MatMul operator
Pipeline #68063 passed
...@@ -112,24 +112,19 @@ bool checkArchitecture(std::shared_ptr<GraphView> graphView) ...@@ -112,24 +112,19 @@ bool checkArchitecture(std::shared_ptr<GraphView> graphView)
void prepareNetwork(std::shared_ptr<GraphView> graphView) void prepareNetwork(std::shared_ptr<GraphView> graphView)
{ {
// XXX remove this !
sanitizeNodeNames(graphView);
// remove the flatten nodes // remove the flatten nodes
removeFlatten(graphView); removeFlatten(graphView);
std::vector<std::shared_ptr<Node>> nodeVector = retrieveNodeVector(graphView);
// handle the MatMuls // handle the MatMuls
reorderMatMulInputs(graphView); reorderMatMulInputs(graphView);
// matMulToFC(graphView); // not working properly atm !
matMulToFC(graphView);
// tag the weighted nodes // tag the weighted nodes
std::vector<std::shared_ptr<Node>> nodeVector = retrieveNodeVector(graphView);
for (std::shared_ptr<Node> node : nodeVector) for (std::shared_ptr<Node> node : nodeVector)
{ {
bool isWeighted = isAffine(node); bool isWeighted = isAffine(node);
......
...@@ -176,6 +176,9 @@ void reorderMatMulInputs(std::shared_ptr<GraphView> graphView) ...@@ -176,6 +176,9 @@ void reorderMatMulInputs(std::shared_ptr<GraphView> graphView)
auto newMicroGraph = Sequential({Transpose({1, 0}), newMatMul, Transpose({1, 0})}); auto newMicroGraph = Sequential({Transpose({1, 0}), newMatMul, Transpose({1, 0})});
newMicroGraph->add(newMatMul->getParent(1)); newMicroGraph->add(newMatMul->getParent(1));
newMicroGraph->setDataType(prevTensor->dataType());
newMicroGraph->setBackend(prevTensor->backend());
graphView->replace(prevMicroGraph, newMicroGraph); graphView->replace(prevMicroGraph, newMicroGraph);
} }
} }
......
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