Browse Source

Feature: reset shape of dynamic single op

pull/565/head
l00444296 5 years ago
parent
commit
56649dcc81
1 changed files with 4 additions and 5 deletions
  1. +4
    -5
      ge/generator/ge_generator.cc

+ 4
- 5
ge/generator/ge_generator.cc View File

@@ -259,10 +259,9 @@ static void ResetInputShape(const vector<GeTensor> &inputs, vector<GeTensor> &in
GeShape dynamic_shape(dynamic_shape_dims);

ge::GeTensor inputTensor;
if (shape_ori.GetDims().size() == 0) {
ge::GeTensorDesc desc(shape_ori, format_ori, type_ori);
} else {
ge::GeTensorDesc desc(dynamic_shape, format_ori, type_ori);
ge::GeTensorDesc desc(shape_ori, format_ori, type_ori);
if (shape_ori.GetDims().size() > 0) {
desc.SetShape(dynamic_shape);
}

inputTensor.SetTensorDesc(desc);
@@ -597,7 +596,7 @@ Status GeGenerator::BuildSingleOp(OpDescPtr &op_desc, const vector<GeTensor> &in
const string &model_file_name, OpEngineType engine_type, ModelBufferData &model_buff,
bool is_offline) {
if (is_offline) {
(void)AttrUtils::SetBool(data_op, ATTR_DYNAMIC_SHAPE_SINGLE_AICPU, true);
(void)AttrUtils::SetBool(op_desc, ATTR_DYNAMIC_SHAPE_SINGLE_AICPU, true);
}
if (CheckForSingleOp(op_desc, inputs, outputs) != SUCCESS) {
GELOGE(PARAM_INVALID, "input param is invalid when build single op!");


Loading…
Cancel
Save