| @@ -846,18 +846,23 @@ Status UpdateDataOpShapeRange(const OpDescPtr &op, | |||||
| GELOGE(PARAM_INVALID, "[Check][OpDescPtr] Check shape by shape range failed for op:%s.", data_op_name.c_str()); | GELOGE(PARAM_INVALID, "[Check][OpDescPtr] Check shape by shape range failed for op:%s.", data_op_name.c_str()); | ||||
| return PARAM_INVALID; | return PARAM_INVALID; | ||||
| } | } | ||||
| for (size_t idx = 0; idx < cur_shape_range.size(); idx++) { | |||||
| std::vector<int64_t> dims; | |||||
| for (size_t idx = 0; idx < cur_shape_range.size(); ++idx) { | |||||
| auto left_range = cur_shape_range[idx].first; | auto left_range = cur_shape_range[idx].first; | ||||
| auto right_range = cur_shape_range[idx].second; | auto right_range = cur_shape_range[idx].second; | ||||
| if (left_range != right_range) { | if (left_range != right_range) { | ||||
| origin_shape.SetDim(idx, UNKNOWN_DIM); | |||||
| dims.push_back(UNKNOWN_DIM); | |||||
| } else { | |||||
| dims.push_back(left_range); | |||||
| } | } | ||||
| } | } | ||||
| origin_shape = GeShape(dims); | |||||
| tensor_input->SetShape(origin_shape); | tensor_input->SetShape(origin_shape); | ||||
| tensor_input->SetShapeRange(cur_shape_range); | tensor_input->SetShapeRange(cur_shape_range); | ||||
| tensor_output->SetShape(origin_shape); | tensor_output->SetShape(origin_shape); | ||||
| tensor_output->SetShapeRange(cur_shape_range); | tensor_output->SetShapeRange(cur_shape_range); | ||||
| GELOGI("Update input [%s] shape range info", data_op_name.c_str()); | |||||
| GELOGI("Update input [%s] shape range and shape [%s] info success.", | |||||
| data_op_name.c_str(), origin_shape.ToString().c_str()); | |||||
| } else { | } else { | ||||
| GELOGI("No need to update input [%s] attr because not found from input_shape_range.", data_op_name.c_str()); | GELOGI("No need to update input [%s] attr because not found from input_shape_range.", data_op_name.c_str()); | ||||
| } | } | ||||
| @@ -899,18 +904,23 @@ Status UpdateDataOpShapeRange(const OpDescPtr &op, | |||||
| GELOGE(PARAM_INVALID, "[Check][OpDescPtr] Check shape by shape range failed for op:%s.", data_op_name.c_str()); | GELOGE(PARAM_INVALID, "[Check][OpDescPtr] Check shape by shape range failed for op:%s.", data_op_name.c_str()); | ||||
| return PARAM_INVALID; | return PARAM_INVALID; | ||||
| } | } | ||||
| std::vector<int64_t> dims; | |||||
| for (size_t idx = 0; idx < cur_shape_range.size(); ++idx) { | for (size_t idx = 0; idx < cur_shape_range.size(); ++idx) { | ||||
| auto left_range = cur_shape_range[idx].first; | auto left_range = cur_shape_range[idx].first; | ||||
| auto right_range = cur_shape_range[idx].second; | auto right_range = cur_shape_range[idx].second; | ||||
| if (left_range != right_range) { | if (left_range != right_range) { | ||||
| origin_shape.SetDim(idx, UNKNOWN_DIM); | |||||
| dims.push_back(UNKNOWN_DIM); | |||||
| } else { | |||||
| dims.push_back(left_range); | |||||
| } | } | ||||
| } | } | ||||
| origin_shape = GeShape(dims); | |||||
| tensor_input->SetShape(origin_shape); | tensor_input->SetShape(origin_shape); | ||||
| tensor_input->SetShapeRange(cur_shape_range); | tensor_input->SetShapeRange(cur_shape_range); | ||||
| tensor_output->SetShape(origin_shape); | tensor_output->SetShape(origin_shape); | ||||
| tensor_output->SetShapeRange(cur_shape_range); | 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 and shape [%s] info success.", | |||||
| data_op_name.c_str(), origin_shape.ToString().c_str()); | |||||
| return SUCCESS; | return SUCCESS; | ||||
| } | } | ||||