Browse Source

[MS][LITE] clear static check error

pull/14841/head
cjh9368 4 years ago
parent
commit
a9cf5eb485
2 changed files with 3 additions and 1 deletions
  1. +1
    -1
      mindspore/lite/tools/converter/converter_flags.cc
  2. +2
    -0
      mindspore/lite/tools/optimizer/fusion/conv_transform_fusion.cc

+ 1
- 1
mindspore/lite/tools/converter/converter_flags.cc View File

@@ -104,7 +104,7 @@ int Flags::InitFmk() {
}

bool Flags::IsValidNum(const std::string &str, int *num) {
char *ptr;
char *ptr = nullptr;
*num = strtol(str.c_str(), &ptr, 10);
return ptr == (str.c_str() + str.size());
}


+ 2
- 0
mindspore/lite/tools/optimizer/fusion/conv_transform_fusion.cc View File

@@ -60,6 +60,7 @@ void GenerateNewWeightConv2D(float *dst_weight, const float *conv_weight, const
dst_weight[i] = conv_weight[i] * scale_weight[i % kernel_num];
}
} else {
MS_ASSERT(kernel_num > 0);
auto kernel_size = weight_shape_size / kernel_num;
for (int i = 0; i < kernel_num; i++) {
for (int j = 0; j < kernel_size; j++) {
@@ -87,6 +88,7 @@ void GenerateNewWeightConv2DTranspose(float *dst_weight, const float *scale_weig
}
}
} else {
MS_ASSERT(group > 0);
auto cin_group = weight_tensor->shape()[0] / group;
int area_size = weight_tensor->shape()[2] * weight_tensor->shape()[3];
int cout_size = kernel_num * area_size;


Loading…
Cancel
Save