From 062711041c9e995630b11260e7aee2fbf984f6b7 Mon Sep 17 00:00:00 2001 From: y00500818 Date: Fri, 5 Mar 2021 17:34:59 +0800 Subject: [PATCH] update data index in atc --- ge/offline/main.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ge/offline/main.cc b/ge/offline/main.cc index 3d6dbf13..28df9969 100755 --- a/ge/offline/main.cc +++ b/ge/offline/main.cc @@ -798,11 +798,17 @@ void SaveCustomCaffeProtoPath() { Status CreateInputsForInference(const ge::Graph &graph, vector &inputs) { auto compute_graph = ge::GraphUtils::GetComputeGraph(graph); GE_CHECK_NOTNULL(compute_graph); + int64_t index = 0; for (ge::NodePtr &input_node : compute_graph->GetAllNodes()) { GE_CHECK_NOTNULL(input_node); ge::OpDescPtr op = input_node->GetOpDesc(); GE_CHECK_NOTNULL(op); if (op->GetType() == ge::DATA) { + if (!op->HasAttr(ge::ATTR_NAME_INDEX)) { + (void)ge::AttrUtils::SetInt(op, ge::ATTR_NAME_INDEX, index); + GELOGD("Set attr index:%ld for data op:%s", index, op->GetName().c_str()); + } + index++; GELOGI("Data op inputDesc size is: %zu", op->GetAllInputsDesc().size()); ge::GeTensorDesc tensor = op->GetInputDesc(0); string data_op_name = op->GetName();