diff options
Diffstat (limited to 'runtimes/neurun/test/graph/verifier/Verifier.cc')
-rw-r--r-- | runtimes/neurun/test/graph/verifier/Verifier.cc | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/runtimes/neurun/test/graph/verifier/Verifier.cc b/runtimes/neurun/test/graph/verifier/Verifier.cc index a37b0ac1f..45e4d727b 100644 --- a/runtimes/neurun/test/graph/verifier/Verifier.cc +++ b/runtimes/neurun/test/graph/verifier/Verifier.cc @@ -16,36 +16,37 @@ #include <gtest/gtest.h> -#include "model/operation/Node.h" +#include "model/Operation.h" #include "graph/Graph.h" #include "graph/verifier/Verifier.h" #include "cpp14/memory.h" -#include "model/operand/Object.h" +#include "model/Model.h" +#include "model/Operand.h" #include "../MockNode.h" -using IndexSet = neurun::model::operand::IndexSet; +using IndexSet = neurun::model::OperandIndexSequence; using MockNode = neurun_test::graph::SimpleMockNode; TEST(Verifier, dag_checker) { - neurun::graph::Graph graph; - neurun::graph::verifier::DAGChecker verifier; + std::unique_ptr<neurun::model::Model> model = nnfw::cpp14::make_unique<neurun::model::Model>(); - ::neurun::model::operand::Shape shape{1u}; - ::neurun::model::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; - shape.dim(0) = 3; + ::neurun::model::Shape shape{3}; + ::neurun::model::TypeInfo type{neurun::model::DataType::INT32}; - auto operand1 = graph.addOperand(shape, type); - auto operand2 = graph.addOperand(shape, type); + auto operand1 = model->operands.emplace(shape, type); + auto operand2 = model->operands.emplace(shape, type); - graph.addInput(operand1); - graph.operands().at(operand1).setAsModelInput(); - graph.addOutput(operand2); - graph.operands().at(operand2).setAsOperationOutput(); + model->inputs.append(operand1); + model->outputs.append(operand2); - graph.addOperation(nnfw::cpp14::make_unique<MockNode>(IndexSet{operand1}, IndexSet{operand2})); + model->operations.push( + nnfw::cpp14::make_unique<MockNode>(IndexSet{operand1}, IndexSet{operand2})); + neurun::graph::Graph graph{std::move(model)}; graph.finishBuilding(); + neurun::graph::verifier::DAGChecker verifier; + ASSERT_EQ(verifier.verify(graph), true); } |