diff --git a/mindspore/ccsrc/optimizer/irpass/arithmetic_simplify.h b/mindspore/ccsrc/optimizer/irpass/arithmetic_simplify.h index 8fc8f6fc1a561077a9d19efa9b80c63b057aaf7a..b51d7c70477c3fdac921d81140248acde2ce08a5 100644 --- a/mindspore/ccsrc/optimizer/irpass/arithmetic_simplify.h +++ b/mindspore/ccsrc/optimizer/irpass/arithmetic_simplify.h @@ -101,24 +101,24 @@ class CheckTensorConstant { if (fabs(data2[i] - check_value_) > FLT_EPSILON) { return false; } - return true; } + return true; } else if (tensor_type == TypeId::kNumberTypeFloat64) { double *data2 = reinterpret_cast(tensor_ptr->data_c()); for (int i = 0; i < tensor_ptr->DataSize(); i++) { if (fabs(data2[i] - check_value_) > DBL_EPSILON) { return false; } - return true; } + return true; } else if ((tensor_type == TypeId::kNumberTypeInt32) || (tensor_type == TypeId::kNumberTypeInt)) { int *data2 = reinterpret_cast(tensor_ptr->data_c()); for (int i = 0; i < tensor_ptr->DataSize(); i++) { if (data2[i] != check_value_) { return false; } - return true; } + return true; } // Un-support Data Types return false;