From 312a7994842d1614a8cfff8b17a7fe84be382d5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Wed, 13 Mar 2019 18:16:34 +0900 Subject: [PATCH] Fix SetIO test (#4715) - Remove dynamic casting - Remove unused header - Remove unused alias Signed-off-by: Hyeongseok Oh --- runtimes/neurun/test/graph/operation/SetIO.cc | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) 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]); -- 2.7.4