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

Added folding example

parent 9c5c8aae
No related branches found
No related tags found
2 merge requests!93Release v0.3.0,!72Im2col
Pipeline #49980 failed
......@@ -63,4 +63,14 @@ TEST_CASE("[ConvToMatMul] conv") {
auto g1OutOp = std::static_pointer_cast<OperatorTensor>((*g1->outputNodes().cbegin())->getOperator());
auto g2OutOp = std::static_pointer_cast<OperatorTensor>((*g1->outputNodes().cbegin())->getOperator());
REQUIRE(*(g1OutOp->getOutput(0)) == *(g2OutOp->getOutput(0)));
// Simplify the graph: freeze parameters to allow reshaping of the Producers
for (auto node : g2->getNodes()) {
if (node->type() == Producer_Op::Type && node->name() != "dataProvider") {
std::static_pointer_cast<Producer_Op>(node->getOperator())->getAttr<bool>("Constant") = true;
}
}
constantFolding(g2);
g2->save("convToMatMul_after_folding");
}
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