Browse Source

Bugfix:fix error of get null subgraph

tags/v1.3.0
lichun 3 years ago
parent
commit
0954fff29b
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      ge/hybrid/model/hybrid_model_builder.cc

+ 7
- 3
ge/hybrid/model/hybrid_model_builder.cc View File

@@ -1039,9 +1039,13 @@ Status HybridModelBuilder::InitWeights() {
GELOGI("Init weight mem successfully, weight base %p, weight size = %zu",
weight_base,
sub_weight_buffer->GetSize());
auto root_graph = ge_root_model_->GetRootGraph()->GetSubgraph(subgraph_model.first);
hybrid_model_.weight_buffer_map_.emplace(root_graph->GetName(), std::move(sub_weight_buffer));
for (auto &node : root_graph->GetDirectNode()) {
auto subgraph = GraphUtils::GetComputeGraph(subgraph_model.second->GetGraph());
if (subgraph != ge_root_model_->GetRootGraph()) {
subgraph = ge_root_model_->GetRootGraph()->GetSubgraph(subgraph_model.first);
}
GE_CHECK_NOTNULL(subgraph);
hybrid_model_.weight_buffer_map_.emplace(subgraph->GetName(), std::move(sub_weight_buffer));
for (auto &node : subgraph->GetDirectNode()) {
if (node->GetType() != CONSTANT) {
continue;
}


Loading…
Cancel
Save