!2277 fix arithmetic simplify

Merge pull request !2277 from xianwz/r0.3
This commit is contained in:
mindspore-ci-bot 2020-06-18 14:09:15 +08:00 committed by Gitee
commit 147d0cde07
1 changed files with 3 additions and 3 deletions

View File

@ -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<double *>(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<int *>(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;