Skip to content
Snippets Groups Projects
Commit 90465753 authored by Maxence Naud's avatar Maxence Naud
Browse files

Remove useless 'save' in tests and fix a typo

parent 861dd77c
No related branches found
No related tags found
1 merge request!53GraphView inputs/outputs ordering
...@@ -40,7 +40,7 @@ public: ...@@ -40,7 +40,7 @@ public:
/** /**
* @brief Clone the operator using its copy-constructor. * @brief Clone the operator using its copy-constructor.
* @see Operator::MatMul_Op * @see Operator::MetaOperator_Op
*/ */
std::shared_ptr<Operator> clone() const override { std::shared_ptr<Operator> clone() const override {
return std::make_shared<MetaOperator_Op>(*this); return std::make_shared<MetaOperator_Op>(*this);
......
...@@ -113,7 +113,7 @@ TEST_CASE("GraphGeneration from Connector", "[GraphView]") { ...@@ -113,7 +113,7 @@ TEST_CASE("GraphGeneration from Connector", "[GraphView]") {
x= (*node09)({x}); x= (*node09)({x});
x = (*node10)({a, x}); x = (*node10)({a, x});
std::shared_ptr<GraphView> gv = generateGraph({x}); std::shared_ptr<GraphView> gv = generateGraph({x});
gv->save("GraphGeneration"); // gv->save("GraphGeneration");
REQUIRE(nodePtrTo(gv->getOrderedInputs()) == std::vector<std::pair<std::string, IOIndex_t>>({})); REQUIRE(nodePtrTo(gv->getOrderedInputs()) == std::vector<std::pair<std::string, IOIndex_t>>({}));
REQUIRE(nodePtrTo(gv->getOrderedOutputs()) == std::vector<std::pair<std::string, IOIndex_t>>({{"g_matmul1", 0}})); REQUIRE(nodePtrTo(gv->getOrderedOutputs()) == std::vector<std::pair<std::string, IOIndex_t>>({{"g_matmul1", 0}}));
} }
...@@ -164,7 +164,7 @@ TEST_CASE("Connector connection GraphView", "[Connector]") { ...@@ -164,7 +164,7 @@ TEST_CASE("Connector connection GraphView", "[Connector]") {
std::shared_ptr<GraphView> gv = generateGraph({x}); std::shared_ptr<GraphView> gv = generateGraph({x});
REQUIRE(nodePtrTo(gv->getOrderedInputs()) == std::vector<std::pair<std::string, IOIndex_t>>({})); REQUIRE(nodePtrTo(gv->getOrderedInputs()) == std::vector<std::pair<std::string, IOIndex_t>>({}));
REQUIRE(nodePtrTo(gv->getOrderedOutputs()) == std::vector<std::pair<std::string, IOIndex_t>>({{"g_conv3", 0}})); REQUIRE(nodePtrTo(gv->getOrderedOutputs()) == std::vector<std::pair<std::string, IOIndex_t>>({{"g_conv3", 0}}));
gv->save("MultiInputSequentialConnector"); // gv->save("MultiInputSequentialConnector");
REQUIRE(gv->inputNodes().size() == 0U); REQUIRE(gv->inputNodes().size() == 0U);
} }
} }
...@@ -181,7 +181,7 @@ TEST_CASE("Connector Mini-graph", "[Connector]") { ...@@ -181,7 +181,7 @@ TEST_CASE("Connector Mini-graph", "[Connector]") {
std::shared_ptr<GraphView> g = generateGraph({y}); std::shared_ptr<GraphView> g = generateGraph({y});
REQUIRE(nodePtrTo(g->getOrderedInputs()) == std::vector<std::pair<std::string, IOIndex_t>>({})); REQUIRE(nodePtrTo(g->getOrderedInputs()) == std::vector<std::pair<std::string, IOIndex_t>>({}));
REQUIRE(nodePtrTo(g->getOrderedOutputs()) == std::vector<std::pair<std::string, IOIndex_t>>({{"ElemWise", 0}})); REQUIRE(nodePtrTo(g->getOrderedOutputs()) == std::vector<std::pair<std::string, IOIndex_t>>({{"ElemWise", 0}}));
g->save("TestGraph"); // g->save("TestGraph");
} }
TEST_CASE("Structural descrition - Sequential", "[GraphView]") { TEST_CASE("Structural descrition - Sequential", "[GraphView]") {
......
...@@ -55,8 +55,8 @@ TEST_CASE("genRandomGraph", "[GraphView][randomGen]") { ...@@ -55,8 +55,8 @@ TEST_CASE("genRandomGraph", "[GraphView][randomGen]") {
const auto g2 = std::make_shared<GraphView>("g2"); const auto g2 = std::make_shared<GraphView>("g2");
const bool unicity2 = g2->add(randGraph.gen(seed, 10)); const bool unicity2 = g2->add(randGraph.gen(seed, 10));
g1->save("./genRandomGraph1"); // g1->save("./genRandomGraph1");
g2->save("./genRandomGraph2"); // g2->save("./genRandomGraph2");
REQUIRE(unicity1 == unicity2); REQUIRE(unicity1 == unicity2);
...@@ -100,7 +100,7 @@ TEST_CASE("clone", "[GraphView][clone]") { ...@@ -100,7 +100,7 @@ TEST_CASE("clone", "[GraphView][clone]") {
RandomGraph randGraph; RandomGraph randGraph;
const auto g1 = std::make_shared<GraphView>("g1"); const auto g1 = std::make_shared<GraphView>("g1");
g1->add(randGraph.gen(seed, 10)); g1->add(randGraph.gen(seed, 10));
// g1 -> save("GraphView_clone");
const auto g2 = g1->clone(); const auto g2 = g1->clone();
REQUIRE(nodePtrTo(g1->getNodes(), nodePtrToName) == nodePtrTo(g2->getNodes(), nodePtrToName)); REQUIRE(nodePtrTo(g1->getNodes(), nodePtrToName) == nodePtrTo(g2->getNodes(), nodePtrToName));
...@@ -141,8 +141,8 @@ TEST_CASE("clone_with_delete", "[GraphView][cloneDelete]") { ...@@ -141,8 +141,8 @@ TEST_CASE("clone_with_delete", "[GraphView][cloneDelete]") {
const auto g2 = std::make_shared<GraphView>("g2"); const auto g2 = std::make_shared<GraphView>("g2");
const bool unicity2 = g2->add(randGraph.gen(seed, 10)); const bool unicity2 = g2->add(randGraph.gen(seed, 10));
g1->save("./clone_with_delete1"); // g1->save("./clone_with_delete1");
g2->save("./clone_with_delete2"); // g2->save("./clone_with_delete2");
try { try {
const auto gCloned = g1->cloneCallback(&nodeDel); const auto gCloned = g1->cloneCallback(&nodeDel);
...@@ -178,13 +178,13 @@ TEST_CASE("remove", "[GraphView][remove]") { ...@@ -178,13 +178,13 @@ TEST_CASE("remove", "[GraphView][remove]") {
const bool unicity1 = g1->add(randGraph.gen(seed, 10)); const bool unicity1 = g1->add(randGraph.gen(seed, 10));
if (unicity1) { if (unicity1) {
g1->save("./remove1_before"); // g1->save("./remove1_before");
const auto nodes = g1->getNodes(); const auto nodes = g1->getNodes();
int step = 1; int step = 1;
for (auto node : nodes) { for (auto node : nodes) {
if (node->type() == "DelFictive") { if (node->type() == "DelFictive") {
g1->remove(node, false); g1->remove(node, false);
g1->save("./remove1_after" + std::to_string(step)); // g1->save("./remove1_after" + std::to_string(step));
step++; step++;
} }
} }
...@@ -193,8 +193,8 @@ TEST_CASE("remove", "[GraphView][remove]") { ...@@ -193,8 +193,8 @@ TEST_CASE("remove", "[GraphView][remove]") {
const auto g2 = std::make_shared<GraphView>("g2"); const auto g2 = std::make_shared<GraphView>("g2");
g2->add(randGraph.gen(seed, 10)); g2->add(randGraph.gen(seed, 10));
g1->save("./remove1"); // g1->save("./remove1");
g2->save("./remove2"); // g2->save("./remove2");
REQUIRE(nodePtrTo(g1->getNodes(), nodePtrToName) == nodePtrTo(g2->getNodes(), nodePtrToName)); REQUIRE(nodePtrTo(g1->getNodes(), nodePtrToName) == nodePtrTo(g2->getNodes(), nodePtrToName));
// Order not garanteed, because when a node is removed, it can create new GraphView inputs/outputs // Order not garanteed, because when a node is removed, it can create new GraphView inputs/outputs
...@@ -243,7 +243,7 @@ TEST_CASE("[core/graph] GraphView(add)", "[GraphView][add]") { ...@@ -243,7 +243,7 @@ TEST_CASE("[core/graph] GraphView(add)", "[GraphView][add]") {
g->add(GOp5); g->add(GOp5);
std::shared_ptr<Node> GOp6 = GenericOperator("Fictive", 1, 1, 1, "Gop6"); std::shared_ptr<Node> GOp6 = GenericOperator("Fictive", 1, 1, 1, "Gop6");
g->add(GOp6); g->add(GOp6);
g->save("node_alone"); // g->save("node_alone");
REQUIRE(nodePtrTo(g->getOrderedInputs(), nodePtrToName) == std::vector<std::pair<std::string, IOIndex_t>>({{"Gop3", 0}, {"Gop4", 0}, {"Gop5", 0}, {"Gop6", 0}, {"Gop6", 1}})); REQUIRE(nodePtrTo(g->getOrderedInputs(), nodePtrToName) == std::vector<std::pair<std::string, IOIndex_t>>({{"Gop3", 0}, {"Gop4", 0}, {"Gop5", 0}, {"Gop6", 0}, {"Gop6", 1}}));
REQUIRE(nodePtrTo(g->getOrderedOutputs(), nodePtrToName) == std::vector<std::pair<std::string, IOIndex_t>>({{"Gop2", 0}, {"Gop5", 0}, {"Gop6", 0}})); REQUIRE(nodePtrTo(g->getOrderedOutputs(), nodePtrToName) == std::vector<std::pair<std::string, IOIndex_t>>({{"Gop2", 0}, {"Gop5", 0}, {"Gop6", 0}}));
} }
...@@ -423,7 +423,7 @@ TEST_CASE("[core/graph] GraphView(resetConnections)") { ...@@ -423,7 +423,7 @@ TEST_CASE("[core/graph] GraphView(resetConnections)") {
} }
} }
SECTION("disconnect data iput + learnable parameters") { SECTION("disconnect data input + learnable parameters") {
std::shared_ptr<Node> conv = GenericOperator("Conv", 1, 0, 1, "c"); std::shared_ptr<Node> conv = GenericOperator("Conv", 1, 0, 1, "c");
std::shared_ptr<Node> conv1 = GenericOperator("Conv", 1, 2, 1, "c1"); std::shared_ptr<Node> conv1 = GenericOperator("Conv", 1, 2, 1, "c1");
std::shared_ptr<Node> conv2 = GenericOperator("Conv", 1, 0, 1, "c2"); std::shared_ptr<Node> conv2 = GenericOperator("Conv", 1, 0, 1, "c2");
......
...@@ -61,7 +61,6 @@ TEST_CASE("[cpu/recipies] FuseMulAdd", "[FuseMulAdd][recipies]") { ...@@ -61,7 +61,6 @@ TEST_CASE("[cpu/recipies] FuseMulAdd", "[FuseMulAdd][recipies]") {
// Transform GraphView inplace // Transform GraphView inplace
fuseMulAdd(g); fuseMulAdd(g);
g->save("bonjour");
// Check new GraphView // Check new GraphView
std::set<std::shared_ptr<Node>> newNodes = g->getNodes(); std::set<std::shared_ptr<Node>> newNodes = g->getNodes();
......
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