mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-30 23:18:20 +00:00
add initializer for sub-graph. (#269)
This commit is contained in:
parent
8f3a492682
commit
eb67eadbc6
1 changed files with 8 additions and 0 deletions
|
|
@ -117,6 +117,14 @@ FunctionImpl::FunctionImpl(const onnxruntime::Graph& graph,
|
|||
}
|
||||
sub_graph.AddNode(node->Name(), node->OpType(), node->Description(), inputs, outputs, &node->GetAttributes(), node->Domain());
|
||||
}
|
||||
|
||||
for (auto input : meta_def->inputs) {
|
||||
const onnx::TensorProto* initializer = nullptr;
|
||||
if (graph.GetInitializedTensor(input, initializer)) {
|
||||
sub_graph.AddInitializedTensor(*initializer);
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: if we reuse the nodes in parent graph, maybe we don't need to resolve it.
|
||||
ORT_ENFORCE(sub_graph.Resolve().IsOK());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue