|
|
@@ -393,7 +393,7 @@ bool ParseSingleShapeRange(std::string &shape_range, vector<pair<int64_t, int64_ |
|
|
|
*/ |
|
|
|
Status ParseInputShapeRange(const std::string &shape_range, |
|
|
|
std::map<string, std::vector<std::pair<int64_t, int64_t>>> &shape_range_map) { |
|
|
|
GELOGD("Input shape range %s", shape_range.c_str()); |
|
|
|
GELOGD("Input shape range %s.", shape_range.c_str()); |
|
|
|
|
|
|
|
vector<string> shape_range_vec = StringUtils::Split(shape_range, ';'); |
|
|
|
const int DEFAULT_SHAPE_RANGE_PAIR_SIZE = 2; |
|
|
@@ -432,7 +432,7 @@ Status ParseInputShapeRange(const std::string &shape_range, |
|
|
|
*/ |
|
|
|
Status ParseInputShapeRange(const std::string &shape_range, |
|
|
|
std::vector<std::vector<std::pair<int64_t, int64_t>>> &range) { |
|
|
|
GELOGD("Input shape range %s", shape_range.c_str()); |
|
|
|
GELOGD("Input shape range %s.", shape_range.c_str()); |
|
|
|
|
|
|
|
if (shape_range.size() < 2) { |
|
|
|
REPORT_INPUT_ERROR("E10048", std::vector<std::string>({"shape_range", "reason", "sample"}), |
|
|
@@ -857,7 +857,7 @@ Status UpdateDataOpShapeRange(const OpDescPtr &op, |
|
|
|
tensor_input->SetShapeRange(cur_shape_range); |
|
|
|
tensor_output->SetShape(origin_shape); |
|
|
|
tensor_output->SetShapeRange(cur_shape_range); |
|
|
|
GELOGI("Update input [%s] shape range info", data_op_name.c_str()); |
|
|
|
GELOGI("Update input [%s] shape range info success by name.", data_op_name.c_str()); |
|
|
|
} else { |
|
|
|
GELOGI("No need to update input [%s] attr because not found from input_shape_range.", data_op_name.c_str()); |
|
|
|
} |
|
|
@@ -866,19 +866,14 @@ Status UpdateDataOpShapeRange(const OpDescPtr &op, |
|
|
|
} |
|
|
|
|
|
|
|
Status UpdateDataOpShapeRange(const OpDescPtr &op, |
|
|
|
const vector<vector<pair<int64_t, int64_t>>> &index_shape_range_map) { |
|
|
|
const vector<vector<pair<int64_t, int64_t>>> &index_shape_range_map, |
|
|
|
int64_t index) { |
|
|
|
GE_CHECK_NOTNULL(op); |
|
|
|
if (index_shape_range_map.empty()) { |
|
|
|
GELOGI("Shape range index map of data op [%s] is empty.", op->GetName().c_str()); |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
GeAttrValue::INT index = 0; |
|
|
|
if (!AttrUtils::GetInt(op, ATTR_NAME_INDEX, index)) { |
|
|
|
GELOGW("[%s] Get index from data attr failed.", op->GetName().c_str()); |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
if ((index < 0) || (static_cast<size_t>(index) >= index_shape_range_map.size())) { |
|
|
|
std::string situation = "data op index[" + std::to_string(index) + "]"; |
|
|
|
std::string reason = "it must less than user_input size[" + std::to_string(index_shape_range_map.size()) + "]"; |
|
|
@@ -910,7 +905,7 @@ Status UpdateDataOpShapeRange(const OpDescPtr &op, |
|
|
|
tensor_input->SetShapeRange(cur_shape_range); |
|
|
|
tensor_output->SetShape(origin_shape); |
|
|
|
tensor_output->SetShapeRange(cur_shape_range); |
|
|
|
GELOGI("Update input [%s] shape range info success.", data_op_name.c_str()); |
|
|
|
GELOGI("Update input [%s] shape range info success by index.", data_op_name.c_str()); |
|
|
|
|
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|