From: 박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 Date: Mon, 15 Jul 2019 01:36:41 +0000 (+0900) Subject: [moco/tf] Revise ReLU6 unit test (#4247) X-Git-Tag: nncc_backup~84 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3c460dad33b9e644df4c1878f8073feb584fffa;p=platform%2Fcore%2Fml%2Fnnfw.git [moco/tf] Revise ReLU6 unit test (#4247) This will revise ReLU6 unit test to test only related properties Signed-off-by: SaeHie Park --- diff --git a/contrib/moco-tf/src/Op/Relu6.test.cpp b/contrib/moco-tf/src/Op/Relu6.test.cpp index 8636e2e..271b68c 100644 --- a/contrib/moco-tf/src/Op/Relu6.test.cpp +++ b/contrib/moco-tf/src/Op/Relu6.test.cpp @@ -82,31 +82,12 @@ TEST(TensorFlowImport, relu6_01) EXPECT_TRUE(parse_graphdef(relu6_01_pbtxtdata, graph_def)); std::unique_ptr graph = importer.import(signature, graph_def); - // Check input shape is correct - loco::Graph::InputContext *inputs = graph->inputs(); - ASSERT_EQ(inputs->size(), 1); - loco::GraphInput *input = inputs->at(0); - loco::Pull *pull = input->node(); - ASSERT_EQ(pull->dtype(), loco::DataType::FLOAT32); - ASSERT_EQ(pull->rank(), 2); - loco::Dimension dim2 = 2; - loco::Dimension dim3 = 3; - ASSERT_EQ(pull->dim(0).value(), dim2.value()); - ASSERT_EQ(pull->dim(1).value(), dim3.value()); + // what to test: + // - there should exist ReLU + // - input node should not be nullptr - // Check nodes are correct type - loco::Graph::OutputContext *outputs = graph->outputs(); - ASSERT_EQ(outputs->size(), 1); - loco::GraphOutput *output = outputs->at(0); - loco::Push *push = output->node(); - // Currently we don't know the shape of output node(s) so skip shape checking + loco::ReLU6 *relu6_node = moco::tf::test::find_first_node_bytype(graph.get()); - loco::Graph::NodeContext *nodes = graph->nodes(); - ASSERT_EQ(nodes->size(), 3); - loco::Pull *node0 = dynamic_cast(nodes->at(0)); - ASSERT_EQ(node0, pull); - loco::Push *node2 = dynamic_cast(nodes->at(2)); - ASSERT_EQ(node2, push); - loco::ReLU6 *node1 = dynamic_cast(nodes->at(1)); - ASSERT_NE(node1, nullptr); + ASSERT_NE(relu6_node, nullptr); + ASSERT_NE(relu6_node->input(), nullptr); }