!21563 [lite]code check

Merge pull request !21563 from 徐安越/master
This commit is contained in:
i-robot 2021-08-11 02:46:22 +00:00 committed by Gitee
commit 0f08b98903
2 changed files with 9 additions and 1 deletions

View File

@ -42,7 +42,13 @@ OpParameter *PopulateAdderParameter(const void *prim) {
auto pad_list = value->pad_list();
auto dilation = value->dilation();
if (kernel_size == nullptr || stride == nullptr || pad_list == nullptr || dilation == nullptr) {
MS_LOG(ERROR) << "nullptr";
MS_LOG(ERROR) << "exist attr is nullptr";
free(param);
return nullptr;
}
if (kernel_size->size() < kMinShapeSizeTwo || stride->size() < kMinShapeSizeTwo ||
pad_list->size() < kMinShapeSizeFour || dilation->size() < kMinShapeSizeTwo) {
MS_LOG(ERROR) << "exist attr size is invalid.";
free(param);
return nullptr;
}

View File

@ -47,6 +47,8 @@ OpParameter *PopulateConstantOfShapeParameter(const void *prim) {
param->data_type_ = static_cast<int>(value->data_type());
if (val.empty() || val.size() > 1) {
MS_LOG(ERROR) << "The value of constant of shape is empty or more than 1.";
free(param);
return nullptr;
} else {
switch (param->data_type_) {
case kNumberTypeFloat32: