Browse Source

fix bug of unknown shape

tags/v1.2.0
wxl 3 years ago
parent
commit
264867d274
3 changed files with 13 additions and 9 deletions
  1. +3
    -1
      ge/graph/build/model_builder.cc
  2. +5
    -4
      ge/graph/passes/resource_pair_add_control_pass.cc
  3. +5
    -4
      ge/graph/passes/resource_pair_remove_control_pass.cc

+ 3
- 1
ge/graph/build/model_builder.cc View File

@@ -261,7 +261,9 @@ Status ModelBuilder::SetInputOutputDesc() {
GE_IF_BOOL_EXEC(n->GetInAllNodes().empty() && n->GetOutAllNodes().empty(), continue;);

SetInputIsConst(n);
if (IsGeLocalOp(n->GetOpDesc())) {
bool is_unknow = false;
(void)NodeUtils::GetNodeUnknownShapeStatus(*n, is_unknow);
if ((IsGeLocalOp(n->GetOpDesc())) && (!is_unknow)) {
GE_CHK_STATUS_RET(CalcOutputSize(n), "Calculate output size failed");
}
ret = AdjustConstWeightSize(n, weight_offset_);


+ 5
- 4
ge/graph/passes/resource_pair_add_control_pass.cc View File

@@ -63,16 +63,17 @@ Status ResourcePairAddControlPass::Run(ComputeGraphPtr graph) {
NodePtr from_node = prefix_2_node.second;
GE_CHECK_NOTNULL(from_node);
auto to_item_prefix_2_node = prefix_2_node_per_type.find(resource_type_pair.second);
// stackpush and stackpop may exist in two subgraphs, no necessary to report error
if (to_item_prefix_2_node == prefix_2_node_per_type.end()) {
GELOGE(PARAM_INVALID, "find peer type node fail, suffix:%s, from_type:%s, to_type:%s", prefix.c_str(),
GELOGW("find peer type node fail, suffix:%s, from_type:%s, to_type:%s", prefix.c_str(),
resource_type_pair.first.c_str(), resource_type_pair.second.c_str());
return PARAM_INVALID;
continue;
}
auto to_prefix_2_node = to_item_prefix_2_node->second.find(prefix);
if (to_prefix_2_node == to_item_prefix_2_node->second.end()) {
GELOGE(PARAM_INVALID, "find peer prefix node fail, suffix:%s, from_type:%s, to_type:%s", prefix.c_str(),
GELOGw("find peer prefix node fail, suffix:%s, from_type:%s, to_type:%s", prefix.c_str(),
resource_type_pair.first.c_str(), resource_type_pair.second.c_str());
return PARAM_INVALID;
continue;
}
NodePtr to_node = to_prefix_2_node->second;
GE_CHECK_NOTNULL(to_node);


+ 5
- 4
ge/graph/passes/resource_pair_remove_control_pass.cc View File

@@ -63,16 +63,17 @@ Status ResourcePairRemoveControlPass::Run(ComputeGraphPtr graph) {
NodePtr from_node = prefix_2_node.second;
GE_CHECK_NOTNULL(from_node);
auto to_item_prefix_2_node = prefix_2_node_per_type.find(resource_type_pair.second);
// stackpush and stackpop may exist in two subgraphs, no necessary to report error
if (to_item_prefix_2_node == prefix_2_node_per_type.end()) {
GELOGE(INTERNAL_ERROR, "find peer type node fail, suffix:%s, from_type:%s, to_type:%s", prefix.c_str(),
GELOGW("find peer type node fail, suffix:%s, from_type:%s, to_type:%s", prefix.c_str(),
resource_type_pair.first.c_str(), resource_type_pair.second.c_str());
return domi::PARAM_INVALID;
continue;
}
auto to_prefix_2_node = to_item_prefix_2_node->second.find(prefix);
if (to_prefix_2_node == to_item_prefix_2_node->second.end()) {
GELOGE(INTERNAL_ERROR, "find peer prefix node fail, suffix:%s, from_type:%s, to_type:%s", prefix.c_str(),
GELOGW("find peer prefix node fail, suffix:%s, from_type:%s, to_type:%s", prefix.c_str(),
resource_type_pair.first.c_str(), resource_type_pair.second.c_str());
return domi::PARAM_INVALID;
continue;
}
NodePtr to_node = to_prefix_2_node->second;
GE_CHECK_NOTNULL(to_node);


Loading…
Cancel
Save