From: 윤현식/On-Device Lab(SR)/Principal Engineer/삼성전자 Date: Mon, 7 Oct 2019 05:45:23 +0000 (+0900) Subject: [exo-tflite] Rewriting a test using exo::test::TestGraph (#7924) X-Git-Tag: submit/tizen/20191205.083104~934 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bc5bcbfc60e541baed4535d92fc9f50005eaa5da;p=platform%2Fcore%2Fml%2Fnnfw.git [exo-tflite] Rewriting a test using exo::test::TestGraph (#7924) Test was re-written using exo::test::TestGraph and was simplified. Signed-off-by: Hyun Sik Yoon --- diff --git a/compiler/exo-tflite/src/Dialect/Service/TFLShapeInferenceRule.test.cpp b/compiler/exo-tflite/src/Dialect/Service/TFLShapeInferenceRule.test.cpp index 0b174d0..35c8f0b 100644 --- a/compiler/exo-tflite/src/Dialect/Service/TFLShapeInferenceRule.test.cpp +++ b/compiler/exo-tflite/src/Dialect/Service/TFLShapeInferenceRule.test.cpp @@ -33,30 +33,15 @@ TEST(TFLShapeInferenceRuleTest, minimal_with_TFLRelu) { // Create a simple network - auto g = loco::make_graph(); - - auto pull_node = g->nodes()->create(); - { - pull_node->rank(2); - pull_node->dim(0) = 3; - pull_node->dim(1) = 4; - } - - auto tfl_node = g->nodes()->create(); - tfl_node->features(pull_node); - - auto push_node = g->nodes()->create(); - push_node->from(tfl_node); + exo::test::TestGraph graph; + auto tfl_node = graph.append(graph.pull); + graph.complete(tfl_node); - auto input = g->inputs()->create(); + // set shape { - input->name("input"); - loco::link(input, pull_node); - } - auto output = g->outputs()->create(); - { - output->name("output"); - loco::link(output, push_node); + graph.pull->rank(2); + graph.pull->dim(0) = 3; + graph.pull->dim(1) = 4; } // pre-check @@ -70,7 +55,7 @@ TEST(TFLShapeInferenceRuleTest, minimal_with_TFLRelu) rules.bind(loco::CanonicalDialect::get(), &canonical_rule) .bind(locoex::TFLDialect::get(), &tfl_rule); - loco::apply(&rules).to(g.get()); + loco::apply(&rules).to(graph.g.get()); // Verify {