Browse Source

Don't reset -2 when there is aicore op.

tags/v1.2.0
unknown 4 years ago
parent
commit
e52c916f56
1 changed files with 17 additions and 1 deletions
  1. +17
    -1
      ge/generator/ge_generator.cc

+ 17
- 1
ge/generator/ge_generator.cc View File

@@ -692,6 +692,22 @@ namespace {
} }
return SUCCESS; return SUCCESS;
} }

bool CheckNoAicore(const ComputeGraphPtr &graph) {
for (const auto &node : graph->GetDirectNode()) {
if (node == nullptr) {
continue;
}
auto op_desc = node->GetOpDesc();
if (op_desc == nullptr) {
continue;
}
if (op_desc->GetOpEngineName() == kAIcoreEngine) {
return false;
}
}
return true;
}
} }


void GeGenerator::RemoveConst(const vector<GeTensor> &inputs, vector<GeTensor> &outputs) { void GeGenerator::RemoveConst(const vector<GeTensor> &inputs, vector<GeTensor> &outputs) {
@@ -787,7 +803,7 @@ Status GeGenerator::BuildSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &in


bool all_shape = false; bool all_shape = false;
(void)AttrUtils::GetBool(op_desc, kAicpuAllshape, all_shape); (void)AttrUtils::GetBool(op_desc, kAicpuAllshape, all_shape);
if (all_shape) {
if (all_shape && CheckNoAicore(root_graph)) {
GELOGD("Get aicpu all_shape kernel!"); GELOGD("Get aicpu all_shape kernel!");
vector<GeTensor> inputs_dynamic; vector<GeTensor> inputs_dynamic;
vector<GeTensor> outputs_dynamic; vector<GeTensor> outputs_dynamic;


Loading…
Cancel
Save