mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-28 22:56:32 +00:00
Make Graph::InlineFunction be able to process initializers (#11443)
This commit is contained in:
parent
8d6ade9e08
commit
d2ae0f49b2
1 changed files with 6 additions and 0 deletions
|
|
@ -4014,6 +4014,12 @@ Status Graph::InlineFunction(Node& node) {
|
|||
auto uniq_identifier = ss.str();
|
||||
|
||||
const auto& model_path = ModelPath();
|
||||
for (auto& init : subgraph.name_to_initial_tensor_) {
|
||||
const gsl::not_null<TensorProto*> tensor{graph_proto_->add_initializer()};
|
||||
*tensor = *init.second;
|
||||
tensor->set_name(tensor->name() + uniq_identifier);
|
||||
name_to_initial_tensor_[tensor->name()] = tensor;
|
||||
}
|
||||
for (const auto& subgraph_node : subgraph.Nodes()) {
|
||||
if (subgraph_node.OpType() == kConstant) {
|
||||
// Copy constant nodes _value to name_to_initial_tensor_
|
||||
|
|
|
|||
Loading…
Reference in a new issue