Browse Source

Feature: Get default from ge ir graph while no user input shape

tags/v1.2.0
l00444296 3 years ago
parent
commit
4382d78392
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      ge/ir_build/ge_ir_build.cc

+ 3
- 3
ge/ir_build/ge_ir_build.cc View File

@@ -295,8 +295,8 @@ graphStatus Impl::GetDefaultInputShapeAndFormat(const Graph &graph, string &defa
GELOGD("Data op get shape from InputDesc in ge ir graph."); GELOGD("Data op get shape from InputDesc in ge ir graph.");


string tmp_shape_str; string tmp_shape_str;
std::vector<int64_t> tmp_shape = data_shape.GetDims();
if (tmp_shape.size() == 0) {
const std::vector<int64_t> &tmp_shape = data_shape.GetDims();
if (tmp_shape.empty()) {
GELOGW("Data op: %s has zero shape dims!", data_op_name.c_str()); GELOGW("Data op: %s has zero shape dims!", data_op_name.c_str());
} else { } else {
tmp_shape_str += data_op_name + ":"; tmp_shape_str += data_op_name + ":";
@@ -341,7 +341,7 @@ graphStatus Impl::Init(const Graph &graph, const std::map<std::string, std::stri
string tmp_input_format; string tmp_input_format;
if (options_.find("input_shape") == options_.end()) { if (options_.find("input_shape") == options_.end()) {
GE_CHK_BOOL_EXEC(GetDefaultInputShapeAndFormat(graph, input_shape, tmp_input_format) == ge::SUCCESS, GE_CHK_BOOL_EXEC(GetDefaultInputShapeAndFormat(graph, input_shape, tmp_input_format) == ge::SUCCESS,
return ge::GRAPH_PARAM_INVALID, "Get defaule data op shape from graph failed!");
return ge::GRAPH_PARAM_INVALID, "Get default data op shape from graph failed!");
} else { } else {
input_shape = options_["input_shape"]; input_shape = options_["input_shape"];
} }


Loading…
Cancel
Save