From: 오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 Date: Wed, 13 Mar 2019 09:16:34 +0000 (+0900) Subject: Fix SetIO test (#4715) X-Git-Tag: submit/tizen/20190325.013700~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=312a7994842d1614a8cfff8b17a7fe84be382d5d;p=platform%2Fcore%2Fml%2Fnnfw.git Fix SetIO test (#4715) - Remove dynamic casting - Remove unused header - Remove unused alias Signed-off-by: Hyeongseok Oh --- diff --git a/runtimes/neurun/test/graph/operation/SetIO.cc b/runtimes/neurun/test/graph/operation/SetIO.cc index dc389da..ccba87d 100644 --- a/runtimes/neurun/test/graph/operation/SetIO.cc +++ b/runtimes/neurun/test/graph/operation/SetIO.cc @@ -17,9 +17,6 @@ #include #include "graph/Graph.h" -#include "cpp14/memory.h" -#include "model/operation/Conv2DNode.h" -#include "model/operation/ConcatNode.h" #include "model/operand/Index.h" #include "model/operand/IndexSet.h" #include "frontend/wrapper/OperationFactory.h" @@ -28,7 +25,6 @@ using Index = neurun::model::operand::IO::Index; using IndexSet = neurun::model::operand::IndexSet; -using GraphNodeInitParam = neurun::model::operation::Node::InitParam; // TODO remove this TEST(graph_operation_setIO, operation_setIO_conv) { @@ -46,11 +42,12 @@ TEST(graph_operation_setIO, operation_setIO_conv) } uint32_t outoperand = graph.addOperand(shape, type).value(); - using GraphNode = neurun::model::operation::Conv2DNode; + using GraphNode = neurun::model::operation::Node; - auto conv = - std::unique_ptr{dynamic_cast(OperationFactory::instance().create( - ANEURALNETWORKS_CONV_2D, {7, params.data(), 1, &outoperand}))}; + auto conv = std::unique_ptr{OperationFactory::instance().create( + ANEURALNETWORKS_CONV_2D, {7, params.data(), 1, &outoperand})}; + + ASSERT_NE(conv, nullptr); ASSERT_EQ(conv->getInputs().at(Index{0}).value(), params[0]); conv->setInputs({8, 9, 10}); ASSERT_NE(conv->getInputs().at(Index{0}).value(), params[0]); @@ -73,12 +70,12 @@ TEST(graph_operation_setIO, operation_setIO_concat) } uint32_t outoperand = graph.addOperand(shape, type).value(); - using GraphNode = neurun::model::operation::ConcatNode; + using GraphNode = neurun::model::operation::Node; - auto concat = - std::unique_ptr{dynamic_cast(OperationFactory::instance().create( - ANEURALNETWORKS_CONCATENATION, {7, params.data(), 1, &outoperand}))}; + auto concat = std::unique_ptr{OperationFactory::instance().create( + ANEURALNETWORKS_CONCATENATION, {7, params.data(), 1, &outoperand})}; + ASSERT_NE(concat, nullptr); ASSERT_EQ(concat->getInputs().size(), 6); ASSERT_EQ(concat->getInputs().at(Index{0}).value(), params[0]);