g->markOutput(opNode);
// Run shape inference
- auto shapeInferencer = new ShapeInference();
- g->accept(shapeInferencer);
- delete shapeInferencer;
+ ShapeInference shapeInferencer;
+ g->accept(&shapeInferencer);
return g;
}
const OperatorInfo* opInfo = GetParam();
std::unique_ptr<Graph> g = make_graph(opInfo);
- auto interpreter = new core::NNInterpreter();
+ core::NNInterpreter interpreter;
for (unsigned int i = 0; i < opInfo->inputs()->size(); ++i)
{
- interpreter->setInput("x" + std::to_string(i), *getTensor(opInfo->inputs()->Get(i)));
+ interpreter.setInput("x" + std::to_string(i), *getTensor(opInfo->inputs()->Get(i)));
}
- g->accept(interpreter);
+ g->accept(&interpreter);
// TODO: Get and check equality for multiple outputs and results.
- auto res = interpreter->getResult(g->getOutput("y"))[0];
+ auto res = interpreter.getResult(g->getOutput("y"))[0];
assertTensorEq(res, *getTensor(opInfo->results()->Get(0)));
-
- delete interpreter;
}
INSTANTIATE_TEST_CASE_P(InterpTestSuite, InterpTestFixture,