Browse Source

!27310 fix graph slice error

Merge pull request !27310 from lianliguang/fix-slice-bug
tags/v1.6.0
i-robot Gitee 4 years ago
parent
commit
17f63ad3a7
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      mindspore/ccsrc/frontend/operator/ops_front_infer_function.cc

+ 4
- 1
mindspore/ccsrc/frontend/operator/ops_front_infer_function.cc View File

@@ -560,9 +560,12 @@ AbstractBasePtr InferImplMakeSlice(const AnalysisEnginePtr &, const PrimitivePtr
if (tensor_dtype->isa<Bool>()) {
auto *bool_value = static_cast<bool *>(value->data_c());
slice_args.push_back(MakeValue((static_cast<int64_t>(*bool_value)))->ToAbstract());
} else if (tensor_dtype->isa<Int>()) {
} else if (tensor_dtype == kInt64) {
auto *int_value = static_cast<int64_t *>(value->data_c());
slice_args.push_back(MakeValue((*int_value))->ToAbstract());
} else if (tensor_dtype == kInt32) {
auto *int_value = static_cast<int32_t *>(value->data_c());
slice_args.push_back(MakeValue((*int_value))->ToAbstract());
} else {
MS_EXCEPTION(TypeError) << "The input tensor type of the MakeSlice operator must be int or bool, but got "
<< tensor_dtype->ToString();


Loading…
Cancel
Save