Browse Source

Reset shape_range when input is -1.

tags/v1.2.0
unknown 3 years ago
parent
commit
ade32982b7
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      ge/generator/ge_generator.cc

+ 2
- 0
ge/generator/ge_generator.cc View File

@@ -272,6 +272,7 @@ static void ResetTensorVecShape(const vector<GeTensor> &inputs, vector<GeTensor>


std::vector<int64_t> dynamic_shape_dims = {kDynamicDimValue}; std::vector<int64_t> dynamic_shape_dims = {kDynamicDimValue};
GeShape dynamic_shape(dynamic_shape_dims); GeShape dynamic_shape(dynamic_shape_dims);
std::vector<std::pair<int64_t, int64_t>> dynamic_shape_range;


ge::GeTensor inputTensor; ge::GeTensor inputTensor;
ge::GeTensorDesc desc(input_desc); ge::GeTensorDesc desc(input_desc);
@@ -280,6 +281,7 @@ static void ResetTensorVecShape(const vector<GeTensor> &inputs, vector<GeTensor>
(void)AttrUtils::GetBool(input_desc, CONST_ATTR_NAME_INPUT, is_const); (void)AttrUtils::GetBool(input_desc, CONST_ATTR_NAME_INPUT, is_const);
if (!is_const && shape_ori.GetDims().size() > 0) { if (!is_const && shape_ori.GetDims().size() > 0) {
desc.SetShape(dynamic_shape); desc.SetShape(dynamic_shape);
desc.SetShapeRange(dynamic_shape_range);
} }


inputTensor.SetTensorDesc(desc); inputTensor.SetTensorDesc(desc);


Loading…
Cancel
Save