#include <gtest/gtest.h>
#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"
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)
{
}
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<GraphNode>{dynamic_cast<GraphNode *>(OperationFactory::instance().create(
- ANEURALNETWORKS_CONV_2D, {7, params.data(), 1, &outoperand}))};
+ auto conv = std::unique_ptr<GraphNode>{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]);
}
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<GraphNode>{dynamic_cast<GraphNode *>(OperationFactory::instance().create(
- ANEURALNETWORKS_CONCATENATION, {7, params.data(), 1, &outoperand}))};
+ auto concat = std::unique_ptr<GraphNode>{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]);