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