}
}
-void convert_graph(::onnx::GraphProto &onnx_graph_proto, loco::Graph *graph)
+void convert_graph(::onnx::ModelProto &onnx_model_proto, loco::Graph *graph)
{
auto nodes = stdex::make_unique<moco::onnx::SymbolTable>();
auto input_names = stdex::make_unique<moco::onnx::SymbolTable>();
// 3. Set graph input
// 4. Create loco::Push node and set input and set graph output
+ assert(onnx_model_proto.has_graph());
+ ::onnx::GraphProto onnx_graph_proto = onnx_model_proto.graph();
+
// 1. Convert all the nodes to loco::Node
for (const auto &n : onnx_graph_proto.node())
{
std::unique_ptr<loco::Graph> Frontend::load(const char *modelfile, FileType type) const
{
::onnx::ModelProto onnx_model_proto;
- ::onnx::GraphProto onnx_graph_proto;
load_onnx(modelfile, type, onnx_model_proto);
- onnx_graph_proto = onnx_model_proto.graph();
-
auto graph = loco::make_graph();
- convert_graph(onnx_graph_proto, graph.get());
+ convert_graph(onnx_model_proto, graph.get());
return std::move(graph);
}