From c0e58bacf38e135fe1ac3b68fca73498a2c67a23 Mon Sep 17 00:00:00 2001 From: l00444296 Date: Tue, 8 Dec 2020 20:39:36 +0800 Subject: [PATCH] Feature: Get default from ge ir graph while no user input shape --- ge/ir_build/ge_ir_build.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ge/ir_build/ge_ir_build.cc b/ge/ir_build/ge_ir_build.cc index 06954ed5..a206a164 100644 --- a/ge/ir_build/ge_ir_build.cc +++ b/ge/ir_build/ge_ir_build.cc @@ -295,8 +295,8 @@ graphStatus Impl::GetDefaultInputShapeAndFormat(const Graph &graph, string &defa GELOGD("Data op get shape from InputDesc in ge ir graph."); string tmp_shape_str; - std::vector tmp_shape = data_shape.GetDims(); - if (tmp_shape.size() == 0) { + const std::vector &tmp_shape = data_shape.GetDims(); + if (tmp_shape.empty()) { GELOGW("Data op: %s has zero shape dims!", data_op_name.c_str()); } else { tmp_shape_str += data_op_name + ":"; @@ -341,7 +341,7 @@ graphStatus Impl::Init(const Graph &graph, const std::map